{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"500 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Hadamard Action: An Introduction to Quantum Circuitry\n",
    "## 2018 submission for the *Teach Me QISKit* Tutorial Competition\n",
    "\n",
    "### Contributors\n",
    "\n",
    "Connor Fieweger"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Contents:\n",
    "    * Introduction\n",
    "        i) Problem of interest\n",
    "            - Reading a Circuit Diagram\n",
    "        ii) Theory\n",
    "    1. Approach 1\n",
    "    2. Approach 2\n",
    "    3. Approach 3\n",
    "    * Appendix: Further Materials"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Introduction:\n",
    "   The following jupyter notebook presents three different\n",
    "    approaches to solving the same simple yet clever quantum\n",
    "    computational exercise that demonstrates the flow of\n",
    "    information through a quantum logic machine. By solving\n",
    "    this same problem through several different means, the notebook\n",
    "    aims to teach an understanding of evaluating circuit diagrams that\n",
    "    does not depend on only one method of interpretation. Rather, \n",
    "    the reader will find that there are multiple modes of understanding \n",
    "    quantum information processing and quantum circuity, including\n",
    "    those that use classical computation to assist in interfacing\n",
    "    with quantum information -- in particular the Qiskit library.\n",
    "    Seeing the same problem worked in parallel both with and without \n",
    "    the Qiskit library aims to show its benefit and develop a working knowledge \n",
    "    of the library basics in preparation for more detailed tutorials such\n",
    "    as those provided by IBM on the Qiskit GitHub."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## i) Problem of interest"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The exercise undertaken in the following notebooks is to show that the following two quantum\n",
    "circuits are equivalent:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/hadamard_action.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"750 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "To a quantum information scientist, this ought to be seen as a clever result that demonstrates \n",
    "the interesting way in which quantum logic machines operate. To anyone else, it probably doesn't mean much -- you may not even know what the drawings mean, so I'll entertain a more detailed breakdown in order to address this focus topic of reading quantum circuit diagrams.\n",
    "\n",
    "In addition, for those without background in quantum computation at all but are here because they are interested in entering the field, a brief introduction (this indented section can be skipped by those already familiar with the concept of quantum computation)\n",
    "\n",
    "- Similarly to classical computers, quantum computers operate by performing logic operations on the elements of a 'register', or a bank of objects that can store information. In a classical computer, these are called 'bits', and they can store information by being either in either an 'off' or an 'on' state (0 or 1, respectively)\\*. The computations allowed/enabled by objects that store information in this binary way are a result of the family of binary logic operations called 'Boolean algebra', and these computations are performed by the familiar computers we have all around us today. This algebra of binary operations, however, has certain shortcomings in terms of ability to solve certain problems as a result of physical constraints on the bits -- perhaps a computation requires so many bits that to build a big enough register in the real world would be impossible, or perhaps the computation takes a certain amount of time to perform on a bit, and as the number of bits increases the required computation time is unreasonable for practice. Some of these problems, however, are more tractable when one stores the information differently -- i.e. we are not limited by the characteristcs of binary logic if the information is stored in something other than a binary. This is exactly what a quantum computer does. Rather than storing our information in a binary bit object, we can store it as a *vector*, which follows logic operations according to the family of operations called vector algebra. The vector nature of the object naturally invites physical objects whose properties are described by quantum mechanics (qubits) as the physical object to store the information in, since quantum states are also vectors and therefore support computational realization of vector algebra operations. One particular advantage of vectors stored as quantum objects is that the qubits can be in superpositions of states -- in either an 'off' *and* an 'on' state (called |0> and |1>, respectively)\\*. This method of storing information is not the best for all computations, in which case classical is usually favorable due to relative technical ease, but for the computations classical computers cannot achieve, quantum computers have often been shown to overcome the computational expense.\n",
    "\n",
    "    A famous example is RSA-encryption, a common cryptographic method that relies on the fact that one of those problems that classical computers have trouble with is factoring large numbers that are the product of two prime numbers. Since this impossibility was thought of as a constant for contemporary computers, it is used to secure information away from those who do not already know the prime factors. Quantum computation received a lot of research attention when a theorist found that a quantum logic machine could use the advantages of vector algebra to compute these primes, rendering what was thought to be one of the strongest possible and practically ubiquitous encryption techniques critically vulnerable if a quantum computer were to ever be built. This reality of such a machine was far away at the time of the theoretical result due to the difficulty in engineering precise control over quantum objects, but as technology becomes ever-more sophisticated, the research community is working towards a point where such a quantum machine is physically realizable, making quantum computation even more relevant. While the circuit diagram for this encryption-breaking computation (called Shor's algorithm) is far more complicated than the one presented here, it is read in more or less the same way, and so this simple example is a good starting point for teaching how to read quantum circuits while still demostrating a uniquely quantum logic result.\n",
    "\n",
    "\\* *Note: while it may be a bit aphoristic, this difference of either/or vs. either/and is really the fundamental difference between classical and quantum logic machines.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Reading a circuit diagram:\n",
    "In order to represent a quantum logic operation, one often draws a 'quantum circuit diagram', which lays out the qubits and order of operations on the qubits pictorially. The circuit is read from left-to-right chronologically, i.e. operations futher to the left happen to the qubits first. Each quantum circuit has a store of qubits, called the quantum register, for performing operations on. Each qubit as it moves from left to right through the circuit is represented by a horizontal line (called a 'wire') with the label of the qubit on the edges of the circuit next to its wire (with $\\left|\\psi\\right>$ being a common character to label a qubit since it has history in quantum mechanics literature). The qubits are ordered top-down, i.e. the first qubit is the topmost line, the second qubit is the second from the top, and so on. The state of the *entire* register is written as the tensor product state of the vector qubits that make up the register.\n",
    "\n",
    "[NOTE: there are two possible conventions for writing the product state -- the first follows the usual tensor product convention of writing elements  left-to-right: \n",
    "\n",
    "$\\Psi_\\rightarrow = \\left|\\psi_1\\right> \\otimes \\left|\\psi_2\\right> \\otimes ... \\otimes \\left|\\psi_n\\right> = \\left|\\psi_1\\psi_2 ... \\psi_n\\right>$ , \n",
    "where this is the common convention used in quantum computation literature\n",
    "\n",
    "while the second follows the classical bit register convention of reading bits from right-to-left\\*: $\\Psi_\\leftarrow = \\left|\\psi_1\\right> \\otimes \\left|\\psi_2\\right> \\otimes ... \\otimes \\left|\\psi_n\\right> = \\left|\\psi_n ... \\psi_2\\psi_1 \\right>$ , where this is a convention used in documentation for quantum programming that interfaces with classical registers (such as in the IBM Qiskit library)]\n",
    "\n",
    "Symbols placed along each wire are called 'gates' and represent operations to be performed on that wire's qubit, and these are what allow the machine to perform computations. There are many types of gate operator that can be applied to a qubit object due to the object's vector properties, and so those who are interested are invited to read into the provided further literature as well as the wikipedia page for quantum gates: https://en.wikipedia.org/wiki/Quantum_logic_gate. For the computations performed in these notebooks, we'll need to understand the X gate, the controlled-not (CNOT) gate, the Hadamard gate, and the measurement gate, so those will be explained in some more detail.\n",
    "\n",
    "\\* * this is a result of the convention established in binary number representation (e.g. (011 = 4(0) + 2(1) + 1(1) = 3) - the first bit in the classical register corresponds to the lowest place value, and so it is written on the right)*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " - X gate: the X gate in quantum computation is equivalent to the 'NOT' gate, or 'bit-flip' operation, in classical computing. Any qubit in the state $\\left|0\\right>$ is flipped to become a $\\left|1\\right>$ and qubits in the state $\\left|1\\right>$ are flipped to $\\left|0\\right>$. The X gate is represented as a box with an 'X' on it.\n",
    " - CNOT: a controlled version of the X gate in that the gate is only applied to the target qubit if the control qubit of the gate is 'on', i.e. in the state $\\left|1\\right>$. The CNOT gate is represented by a dot on the control line connected to a plus circumscribed by a circle on the subject line, with the plussed circle sometimes being replaced by the X gate symbol since they are equivalent. This is one of the most important gates in building quantum logic machines because of the imperative if-this-then-that logic of the gate allowing for conditional evaluations.\n",
    " - Hadamard: So far, it has been said that qubits can exist in states known as $\\left|0\\right>$,$\\left|1\\right>$. Additionally, due to their vector nature and ability to superpose, they can exist in another set of states known as $\\left|+\\right>$,$\\left|-\\right>$. The Hadamard gate is a uniquely quantum gate that serves to switch the qubits between these sets of states (with each of the sets being known as a 'basis'). The effect of the  hadamard gate is such that ($\\left|0\\right>$ is changed to $\\left|+\\right>$ and $\\left|+\\right>$ is changed to $\\left|0\\right>$) and ($\\left|1\\right>$ is changed to $\\left|-\\right>$ and $\\left|-\\right>$ is changed to $\\left|1\\right>$). The Hadamard is represented by a box with an 'H' on it.\n",
    " - Measurement: As described, qubits have an either/and behavior of superposition. Those familiar with quantum mechanics or even just the Schrödinger's cat thought experiment know, however, that this is only when we do not observe the qubit state. When we do, it will 'collapse' down and be fixed to one of the constituent states of the full superposition in the basis of the measurement made (i.e. we must choose to either check either in terms of $\\left|0\\right>$,$\\left|1\\right>$ or in terms of $\\left|+\\right>$,$\\left|-\\right>$). In quantum computation, one usually measures in terms of $\\left|0\\right>$,$\\left|1\\right>$, and so this is called the 'computational basis' (and +- is then called the 'Hadamard basis'). After the measurement is made, the result of collapsing the state in this particular instance can be written onto a classical ancilla\\* bit to store the information, where finding that the qubit is in the state $\\left|0\\right>$ after measurement is written to the classical bit as 0 and finding that the qubit is in the state $\\left|1\\right>$ after measurement is written to the classical bit as 1. Measurement is usually represented as a box with a gauge and an 'M' drawn on it with a line connecting the box to its classical ancilla bit.\n",
    " \n",
    "\\* * ancilla is just a fancy latin word meaning 'helper' or 'slave' that is used in computing literature to describe bits that do not directly participate in a computation but are used to facilitate it. It's a common concept in quantum computation, so it's worth learning.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "With the behavior of the gates broken down as such, all that remains is to apply the gates to the qubits and then measure the final state. If the final states are the same for both, then they're equivalent circuits. Well, easier said than done -- even for a two-qubit, 3-gate set circuit such as ii) this can get tenuous, especially if one chooses to fully write out the quantum circuit state by hand. The advantages offered by a library designed for performing quantum information operations quickly become obvious when considering more complicated/useful circuits, with the usefuls ones often exceding a classical computer's capabilities and requiring implementation on actual quantum circuits."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## b) Theory for each notebook"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Approach 1\n",
    "\n",
    "Most of the the theory for notebook 1 is contained within section a) on reading circuit diagrams. One point, however, ought to be further explained, and this is the action of the Hadamard gate. As said before, this is the action of switching between the $\\left|0\\right>\\left|1\\right>$ basis and the $\\left|+\\right>\\left|-\\right>$ basis. The precise conversion between these states is: \n",
    "\n",
    "$$\\left|+\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> + \\left|1\\right>) \\\\ \\left|-\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> - \\left|1\\right>)$$ \n",
    "\n",
    "The Hadamard thus serves to generate the either/and property of a quantum logic machine (in that a $\\left|+\\right>$ is either a $\\left|0\\right>$ and a $\\left|1\\right>$, and so forth). Indeed, this action of the Hadamard is often a key first step of a quantum algorithm because it generates such superpositions to then make logic operations with."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Approach 2\n",
    "\n",
    "Notebook 2 uses the formalism of linear algebra to represent the qubit states as column vectors and the gate operations as matrices. In these terms, the states $\\left|0\\right>,\\left|1\\right>$ are given by: \n",
    "$$ \\left|0\\right> = \\left(\\begin{array}{c} 1 \\\\ 0 \\end{array}\\right) $$\n",
    "\n",
    "$$ \\left|1\\right> = \\left(\\begin{array}{c} 0 \\\\ 1 \\end{array}\\right) $$\n",
    "\n",
    "and the states $\\left|+\\right>\\left|-\\right>$ are given by:\n",
    "\n",
    "$$ \\left|+\\right> = \\frac{1}{\\sqrt{2}}\\left(\\begin{array}{c} 1 \\\\ 1 \\end{array}\\right) $$\n",
    "\n",
    "$$ \\left|-\\right> = \\frac{1}{\\sqrt{2}}\\left(\\begin{array}{c} 1 \\\\ -1 \\end{array}\\right) $$\n",
    "\n",
    "*Note: from these representations, one can easily see the validity of the conversion between bases provided in the Approach 1 section above.*\n",
    "\n",
    "The tensor product between 2 vectors of length 2 is a vector of length 4 with elements following the pattern:\n",
    "\n",
    "$$ \\left|n\\right> = \\left(\\begin{array}{c} a \\\\ b \\end{array}\\right) $$\n",
    "\n",
    "$$ \\left|m\\right> = \\left(\\begin{array}{c} c \\\\ d \\end{array}\\right) $$\n",
    "\n",
    "$$ \\left|n\\right> \\otimes \\left|m\\right> = \\left(\\begin{array}{c} ac \\\\ ad \\\\ bc \\\\ bd \\end{array}\\right) $$\n",
    "\n",
    "for $\\left|00\\right>$, then, we have:\n",
    "$$\\left|00\\right> = \\left(\\begin{array}{c}\n",
    "        1 \\\\\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|01\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        1 \\\\\n",
    "        0 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|10\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        1 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|11\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        1\n",
    "\\end{array}\\right)$$\n",
    "\n",
    "as stated in the notebook.\n",
    "\n",
    "Just as the qubit states are represented by column vectors, the gates as they operate on these qubit column vectors are linear operators as represented by matrices. The effect of the matrix ought to be such that it follows the defining logic of the gate -- i.e. the X gate matrix sends the column vector representation of $\\left|0\\right>$ to the column vector representation of $\\left|1\\right>$, the H gate sends the column vector representation of $\\left|0\\right>$ to the column vector representation of $\\left|+\\right>$, and so on. The matrices employed are H and CNOT (controlled either by line 1 or 2), so lets find the matrices that satisfy this quality of fulfilling the defining action of the gate of interest.\n",
    "\n",
    "   - H: Building up from the defining logic, we need:\n",
    "    $$ H\\left|0\\right> = \\left|+\\right>, \\ H\\left|1\\right> = \\left|-\\right> $$\n",
    "    This is satisfied by a matrix of the form:\n",
    "    $$ H = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right]$$\n",
    "    Where this has been constructed by assigning each initial state to a column and writing out the target state column vector in this position -- i.e. the column vector for $\\left|+\\right>$ occupies column 1, which corresponds to $\\left|0\\right>$, and the column vector $\\left|-\\right>$ occupies column 2, which corresponds to $\\left|1\\right>$.\n",
    "    Just to check,\n",
    "    $$ H\\left|0\\right> = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] \\left(\\begin{array}{c} 1 \\\\ 0 \\end{array}\\right) = \\frac{1}{\\sqrt{2}}\\left(\\begin{array}{c} 1 \\\\ 1 \\end{array}\\right) = \\left|+\\right> \\checkmark $$\n",
    "    $$ H\\left|1\\right> = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] \\left(\\begin{array}{c} 0 \\\\ 1 \\end{array}\\right) = \\frac{1}{\\sqrt{2}}\\left(\\begin{array}{c} 1 \\\\ -1 \\end{array}\\right) = \\left|-\\right> \\checkmark $$\n",
    "    \n",
    "    Now, we're often going to be applying multiple H gates in parallel to the product state that represents the full n-qubit quantum register state, so to expand this 2 x 2 matrix to a 2n x 2n matrix (referred to as $H^{\\otimes n}$) would allow for applying all the parallel H gates simultaneously to the product state of n qubits. Similar to how the product state for the column vectors is formed, one can do this by taking tensor products of the H gate n times. The tensor product for matrices is executed representationally by embedding the second matrix into the first, i.e.: \n",
    "    \n",
    "    $$ H \\otimes H = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] \\otimes H = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 \\cdot H & 1 \\cdot H \\\\ 1 \\cdot H & -1 \\cdot H \\end{array}\\right] = \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 \\cdot \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] & 1 \\cdot \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right]  \\\\ 1 \\cdot \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] & -1 \\cdot \\frac{1}{\\sqrt{2}}\\left[\\begin{array}{cc} 1 & 1 \\\\ 1 & -1 \\end{array}\\right] \\end{array}\\right] = \\frac{1}{2}\\left[\\begin{array}{cccc}\n",
    "        1 & 1 & 1 & 1 \\\\\n",
    "        1 & -1 & 1 & -1 \\\\\n",
    "        1 & 1 & -1 & -1 \\\\\n",
    "        1 & -1 & -1 & 1\n",
    "\\end{array}\\right]$$\n",
    "  - CNOT_1: A CNOT gate controlled by line one has the action of flipping the second bit only if the first bit is |1>. This is satisfied by a matrix of the form:\n",
    "  \n",
    "  $$CNOT_1 = \\left[\\begin{array}{cccc}\n",
    "        1 & 0 & 0 & 0 \\\\\n",
    "        0 & 1 & 0 & 0 \\\\\n",
    "        0 & 0 & 0 & 1 \\\\\n",
    "        0 & 0 & 1 & 0\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "    where the fulfilment of the $CNOT_1$ definition can be checked through writing out the application of this matrix onto each state. This matrix was formed in a manner similar to the method for H, where the column vector representation of the final state is written in the column corresponding to the initial state following the defining logic of the $CNOT_1$ gate. The convention is to assign the initial state 00 to column 1, 01 to 2, 10 to 3, and 11 to 4.\n",
    "    - CNOT_2: A CNOT gate controlled by line two has the action of flipping the first bit only if the second bit is |1>. This is satisfied by a matrix of the form:\n",
    "    \n",
    "  $$CNOT_2 = \\left[\\begin{array}{cccc}\n",
    "        1 & 0 & 0 & 0 \\\\\n",
    "        0 & 0 & 0 & 1 \\\\\n",
    "        0 & 0 & 1 & 0 \\\\\n",
    "        0 & 1 & 0 & 0\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "    where the fulfilment of the $CNOT_2$ definition can be checked through writing out  the application of this matrix onto each state. This matrix was formed in a manner similar to the method for H, where the column vector representation of the final state is written in the column corresponding to the initial state following the defining logic of the $CNOT_2$ gate. The convention is to assign the initial state 00 to column 1, 01 to 2, 10 to 3, and 11 to 4."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Approach 3\n",
    "\n",
    "The background required for notebook 3 really isn't theory but rather a familiarity with the object-oriented paradigm in Python and the actual Qiskit files. The former is assumed to be known to some degree by the reader given that the audience is programmers looking into quantum information processing libraries. For the latter, readers are strongly encouraged to look through these files, as this is a necessary and unavoidable step to working with just about any API. The notebook introduces the reader to some of these files as well through making a few common, but essential operations in Qiskit by providing sample code that solves the presented problem. With a solution that is already known from the previous two notebooks, one can focus on the library's implementation rather than finding the solution. The problem is short enough such that the reader hopefully doesn't feel overwhelmed by a true quantum algorithm (which are often hefty to digest) and instead clearly sees how quantum circuit diagrams can be realized as Qiskit programs."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Exercise Solutions:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Approach 1"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/hadamard_action.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"750 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In order to show the equivalence of the above circuits, first we'll take the most tedious route of simply writing out the full state after each set of gates and comparing the final states of each circuit. One should note that this method doesn't use any abstraction or coding, rather we simply act as a quantum computer by hand by applying the defining logic of the gates to the input states as one reads the circuit from left to right. This gets a bit clunky even for a fairly simple circuit such as ii), showing the amount of effort this method would require when considering circuits complex enough to execute quantum algorithms worth executing. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit i)\n",
    "For i), the initial state of the input is represented by the tensor product of the two input qubits in the initial register. This is given by:\n",
    "\n",
    "$$\\left|\\Psi\\right> = \\left|\\psi_1\\right> \\otimes \\left|\\psi_2\\right> = \\left|\\psi_1\\psi_2\\right>$$\n",
    "\n",
    "Where each $\\left|\\psi\\right>$ can be either $\\left|0\\right>$ or $\\left|1\\right>$\n",
    "\n",
    "This results in the following set of possible input states for $\\left|\\Psi\\right>: [\\left|00\\right>, \\left|01\\right>, \\left|10\\right>, \\left|11\\right>]$. The action of the CNOT gate controlled by line 1 is such that the second qubit is 'flipped' (i.e. $\\left|0\\right>$ becomes $\\left|1\\right>$ and $\\left|1\\right>$ becomes $\\left|0\\right>$) if the first qubit is in the state $\\left|1\\right>$. This logic gate of 'if-this-then-that' is what makes the CNOT gate absolutely essential to building any quantum logic machine just as it is to building a classical logic machine, only in the classical case the imperative 'if' of 'if-this-then-that' must evaluate to a certainty while in the quantum case it need not. \n",
    "\n",
    "Applying the logic of CNOT to our initial possible register states ($\\left|\\Psi\\right>= [\\left|00\\right>, \\left|01\\right>, \\left|10\\right>, \\left|11\\right>]$, the state after CNOT is found to be\n",
    "\n",
    "($\\left|\\Psi'\\right>= [\\left|00\\right>, \\left|01\\right>, \\left|11\\right>, \\left|10\\right>]$). This is then the final state of circuit i)."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit ii)\n",
    "For ii), this process of writing out the state after each set of gates is as follows (and gets notably lengthy):\n",
    "\n",
    "The initial state $\\left|\\Psi\\right>$ is given as explained before by ($\\left|\\Psi\\right> = [\\left|00\\right>, \\left|01\\right>, \\left|10\\right>, \\left|11\\right>]$). The first set of gates is the Hadamard gate, which has the logic of 0 becomes a + and 1 becomes a -. Applying this logic to the initial state gives the state immediately after the first set of Hadamards and immediately before the CNOT, let's call this state $\\left|\\Psi_1\\right>$. Computing by hand, we find:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$(\\left|\\Psi\\right>) \\rightarrow (\\left|\\Psi_1\\right> = [\\left|++\\right>,\\left|+-\\right>,\\left|-+\\right>,\\left|--\\right>])$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The next set of gates to consider is the CNOT controlled by line 2. Similar to the CNOT controlled by line 1, the action is such that the subject line qubit is flipped if the control line qubit is in the state 1. Wait a second, though... isn't our current state $\\Psi_1$ before the CNOT in terms of $\\left|+\\right>$ and $\\left|-\\right>$? In order to understand exactly the effect of this gate's logic, then, we need to write the $\\left|+\\right>$ and $\\left|-\\right>$ in terms of $\\left|0\\right>$ and $\\left|1\\right>$. This is given by: $\\left|+\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> + \\left|1\\right>)$ and $\\left|-\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> - \\left|1\\right>)$ [see appendix notebook]. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Again computing by hand, the possible $\\left|\\Psi_1\\right>$ in terms of 0s and 1s is $\\left|\\Psi_1\\right>_{0,1} = \\frac{1}{2}[(\\left|0\\right>+\\left|1\\right>)(\\left|0\\right>+\\left|1\\right>),(\\left|0\\right>+\\left|1\\right>)(\\left|0\\right>-\\left|1\\right>),(\\left|0\\right>-\\left|1\\right>)(\\left|0\\right>+\\left|1\\right>),(\\left|0\\right>-\\left|1\\right>)(\\left|0\\right>-\\left|1\\right>)]$. \n",
    "\n",
    "The terms in parenthesis can then be factored into product-states through taking tensor products: $\\left|\\Psi_1\\right> = \\frac{1}{2}[(\\left|00\\right>+\\left|01\\right>+\\left|10\\right>+\\left|11\\right>), (\\left|00\\right>-\\left|01\\right>+\\left|10\\right>-\\left|11\\right>) , (\\left|00\\right>+\\left|01\\right>-\\left|10\\right>+\\left|11\\right>), (\\left|00\\right>-\\left|01\\right>-\\left|10\\right>+\\left|11\\right>)$\n",
    "\n",
    "There we go, the action of the line-2-controlled CNOT is clearer when we write out $\\Psi_1$ in this form: any $\\left|XX \\right>$ terms that have a 1 in the 2nd spot will have the qubit in the 1st spot flip. Applying this logic, we get the state right after the CNOT gate and right before the second set of Hadamards, lets call it '$\\Psi_2$'.\n",
    "\n",
    "$\\left|\\Psi_2\\right> = \\frac{1}{2}[(\\left|00\\right>+\\left|11\\right>+\\left|10\\right>+\\left|01\\right>), (\\left|00\\right>-\\left|11\\right>+\\left|10\\right>-\\left|01\\right>) , (\\left|00\\right>+\\left|11\\right>-\\left|10\\right>+\\left|01\\right>), (\\left|00\\right>-\\left|11\\right>-\\left|10\\right>+\\left|01\\right>)$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The final logic to apply in order to get the final state is again the Hadamard gates' logic of [0 $\\rightarrow$ +, 1 $\\rightarrow$ -]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "$\\left|\\Psi'\\right> = \\frac{1}{2}[(\\left|++\\right>+\\left|--\\right>+\\left|-+\\right>+\\left|+-\\right>), (\\left|++\\right>-\\left|--\\right>+\\left|-+\\right>-\\left|+-\\right>) , (\\left|++\\right>+\\left|--\\right> -\\left|-+\\right>+\\left|+-\\right>), (\\left|++\\right>-\\left|--\\right>-\\left|-+\\right>+\\left|+-\\right>)$.\n",
    "\n",
    "Rearranging such that the term ordering convention is (++,+-,-+,--) as it was before, this becomes:\n",
    "\n",
    "$\\left|\\Psi'\\right> = \\frac{1}{2}[(\\left|++\\right>+\\left|+-\\right>+\\left|-+\\right>+\\left|--\\right>), (\\left|++\\right>-\\left|+-\\right>+\\left|-+\\right>-\\left|--\\right>) , (\\left|++\\right>+\\left|+-\\right>-\\left|-+\\right>+\\left|--\\right>), (\\left|++\\right>+\\left|+-\\right>-\\left|-+\\right>-\\left|--\\right>)$"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "Here we have the final state, but the same issue again: the state is in terms of +- while the known final state for circuit i) is in terms of 01. Rearranging according to the ordering convention as we have done, fortunately, hints at an underlying pattern in the expression's terms that allows for factoring out back to a parenthetical form:\n",
    "$\\left|\\Psi'\\right> = \\frac{1}{2}[(\\left|+\\right>+\\left|-\\right>)(\\left|+\\right>+\\left|-\\right>), (\\left|+\\right>+\\left|-\\right>)(\\left|+\\right>-\\left|-\\right>) , (\\left|+\\right>-\\left|-\\right>)(\\left|+\\right>-\\left|-\\right>), (\\left|+\\right>-\\left|-\\right>)(\\left|+\\right>+\\left|-\\right>)]$\n",
    "\n",
    "Remembering from before that $\\left|+\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> + \\left|1\\right>)$ and $\\left|-\\right> = \\frac{1}{\\sqrt{2}}(\\left|0\\right> - \\left|1\\right>)$, it is easy to see that similarly $\\left|0\\right> = \\frac{1}{\\sqrt{2}}(\\left|+\\right> + \\left|-\\right>)$ and $\\left|1\\right> = \\frac{1}{\\sqrt{2}}(\\left|+\\right> - \\left|-\\right>)$, so $\\left|\\Psi'\\right>$ in terms of $\\left|0\\right>,\\left|1\\right>$ is:\n",
    "\n",
    "$\\left|\\Psi'\\right> = [\\left|00\\right>, \\left|01\\right>, \\left|11\\right>, \\left|10\\right>]$.\n",
    "\n",
    "This is the same as the final state for circuit 1, and so the circuits are considered equivalent $\\square$.\n",
    "\n",
    "From this exercise, one can see a uniquely quantum computational result in that the idea of directionality between control and target in a two-qubit gate and the effect of this directionality is dependent on the basis in which the gate is implemented - neat!"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Approach 2"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/hadamard_action.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"750 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Another approach to showing equivalence of the presented circuit diagrams is to represent the operators on the qubits as matrices and the qubit states as column vectors. The output is found by applying the matrix that represents the action of the circuit onto the initial state column vector to find the final state column vector. Since the numpy library already enables making linear algebra computations such as these, we'll use that to employ classical programming in order to understand this quantum circuit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit i)\n",
    "For i), the initial state of the input is represented by the tensor product of the two input qubits in the initial register. This is given by:\n",
    "\n",
    "$$\\Psi = \\psi_1 \\otimes \\psi_2$$\n",
    "\n",
    "Where each $\\psi$ can be either 0 or 1\n",
    "\n",
    "This results in the following input states for $\\Psi: \\left|00\\right>, \\left|01\\right>, \\left|10\\right>, $ or $\\left|11\\right>$. Represented by column vectors, these are:\n",
    "\n",
    "$$\\left|00\\right> = \\left(\\begin{array}{c}\n",
    "        1 \\\\\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|01\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        1 \\\\\n",
    "        0 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|10\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        1 \\\\\n",
    "        0\n",
    "\\end{array}\\right)$$\n",
    "$$\\left|11\\right> = \\left(\\begin{array}{c}\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        0 \\\\\n",
    "        1\n",
    "\\end{array}\\right)$$\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "zero_zero : \n",
      " [[1]\n",
      " [0]\n",
      " [0]\n",
      " [0]]\n",
      "zero_one : \n",
      " [[0]\n",
      " [1]\n",
      " [0]\n",
      " [0]]\n",
      "one_zero : \n",
      " [[0]\n",
      " [0]\n",
      " [1]\n",
      " [0]]\n",
      "one_one : \n",
      " [[0]\n",
      " [0]\n",
      " [0]\n",
      " [1]]\n"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "# These column vectors can be stored in numpy arrays so that we can operate \n",
    "# on them with the circuit diagram's corresponding matrix (which is to be evaluated)\n",
    "# as follows:\n",
    "zero_zero = np.array([[1],[0],[0],[0]])\n",
    "zero_one = np.array([[0],[1],[0],[0]])\n",
    "one_zero = np.array([[0],[0],[1],[0]])\n",
    "one_one = np.array([[0],[0],[0],[1]])\n",
    "Psi = {'zero_zero': zero_zero, 'zero_one': zero_one, 'one_zero': one_zero, 'one_one': one_one}\n",
    "# ^We can conveniently store all possible input states in a dictionary and then print to check the representations:\n",
    "for key, val in Psi.items():\n",
    "    print(key, ':', '\\n', val)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The action of the circuit gates on this state is simply the CNOT operator. For a control qubit on line 1 and a subject qubit on line 2, CNOT is given by the 4x4 matrix (as discussed in the introduction's theory section): \n",
    "\n",
    "$$CNOT_1 = \\left[\\begin{array}{cccc}\n",
    "        1 & 0 & 0 & 0 \\\\\n",
    "        0 & 1 & 0 & 0 \\\\\n",
    "        0 & 0 & 0 & 1 \\\\\n",
    "        0 & 0 & 1 & 0\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "This matrix is the operator that describes the effect of the circuit on the initial state. By taking $CNOT_1\\left|\\Psi\\right> = \\left|\\Psi'\\right>$, then, the final state for i) can be found."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 0 0 0]\n",
      " [0 1 0 0]\n",
      " [0 0 0 1]\n",
      " [0 0 1 0]]\n"
     ]
    }
   ],
   "source": [
    "# storing CNOT as a numpy array:\n",
    "CNOT_1 = np.matrix([[1, 0, 0, 0],[0, 1, 0, 0],[0, 0, 0, 1],[0, 0, 1, 0]])\n",
    "print(CNOT_1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "FINAL STATE OF i):\n",
      "zero_zero becomes..\n",
      " [[1]\n",
      " [0]\n",
      " [0]\n",
      " [0]]\n",
      "zero_one becomes..\n",
      " [[0]\n",
      " [1]\n",
      " [0]\n",
      " [0]]\n",
      "one_zero becomes..\n",
      " [[0]\n",
      " [0]\n",
      " [0]\n",
      " [1]]\n",
      "one_one becomes..\n",
      " [[0]\n",
      " [0]\n",
      " [1]\n",
      " [0]]\n"
     ]
    }
   ],
   "source": [
    "print('FINAL STATE OF i):')\n",
    "#Apply CNOT to each possible state for |Psi> to find |Psi'>\n",
    "for key, val in Psi.items():\n",
    "    print(key, 'becomes..\\n', CNOT_1*val)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As one can see, the first set of two states (00, 01) has stayed the same, while the second (10, 11) has flipped to (11, 10). This is readily understood when considering the defining logic of the CNOT gate - the subject qubit on line 2 is flipped if the control qubit on line 1 in the state $\\left|1\\right>$. Summatively, then, the action of i) is given by: $[\\left|00\\right>,\\left|01\\right>,\\left|10\\right>,\\left|11\\right>] \\rightarrow [\\left|00\\right>,\\left|01\\right>,\\left|11\\right>,\\left|10\\right>]$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit ii)\n",
    "For ii), a similar examination of the input states and the result when the circuit operation matrix is applied to these states can be done. The input states are the same as those in i), so we can just use the variable 'Psi' that we stored earlier. In order to find the matrix representation of the circuit, a little more depth in considering the matrix that represents the gates is required as follows: "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "First, consider the parallel application of the Hadamard gate 'H' to each wire. In order to represent this as an operator on the two-qubit-tensor-space state ('$\\Psi$'), one needs to take the tensor product of the single-qubit-space's ('$\\psi$') Hadamard with itself: $H \\otimes H = H^{\\otimes 2}$\n",
    "\n",
    "As discussed in the introduction theory section, this is given by:\n",
    "$$\\text{H}^{\\otimes 2} = \\frac{1}{2}\\left[\\begin{array}{cccc}\n",
    "        1 & 1 & 1 & 1 \\\\\n",
    "        1 & -1 & 1 & -1 \\\\\n",
    "        1 & 1 & -1 & -1 \\\\\n",
    "        1 & -1 & -1 & 1\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "This is then the first matrix to consider when finding the matrix that represents the action of circuit ii)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "H_2:\n",
      "[[ 0.5  0.5  0.5  0.5]\n",
      " [ 0.5 -0.5  0.5 -0.5]\n",
      " [ 0.5  0.5 -0.5 -0.5]\n",
      " [ 0.5 -0.5 -0.5  0.5]]\n"
     ]
    }
   ],
   "source": [
    "# storing this in a numpy array:\n",
    "H_2 = .5*np.matrix([[1, 1, 1, 1],[1, -1, 1, -1],[1, 1, -1, -1],[1, -1, -1, 1]])\n",
    "print('H_2:')\n",
    "print(H_2)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The next operation on the qubits is a CNOT controlled by line 2. This is given by the 4x4 matrix (also in the introduction): \n",
    "\n",
    "$$CNOT_2 = \\left[\\begin{array}{cccc}\n",
    "        1 & 0 & 0 & 0 \\\\\n",
    "        0 & 0 & 0 & 1 \\\\\n",
    "        0 & 0 & 1 & 0 \\\\\n",
    "        0 & 1 & 0 & 0\n",
    "\\end{array}\\right]$$\n",
    "\n",
    "This is then the second matrix to consider in finding the matrix that represents the action of circuit ii)."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# storing this in a numpy array:\n",
    "CNOT_2 = np.matrix([[1, 0, 0, 0],[0, 0, 0, 1],[0, 0, 1, 0],[0, 1, 0, 0]])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Finally, the set of parallel hadamard matrices as given by $H^{\\otimes 2}$ is again applied to the two-qubit-space. With this, all matrices that contribute to the circuit's action have been found. Applying each operator to the state as one reads the circuit diagram from left to right, one finds: $(H^{\\otimes 2})(CNOT_2)(H^{\\otimes} 2)\\Psi$ = $\\Psi$ '. The $(H^{\\otimes 2})(CNOT_2)(H^{\\otimes} 2)$ term can be evaluated through matrix multiplication to a single 4x4 matrix that represents the entire circuit as an operator, let's call it 'A'."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "A = H_2*CNOT_2*H_2"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1. 0. 0. 0.]\n",
      " [0. 1. 0. 0.]\n",
      " [0. 0. 0. 1.]\n",
      " [0. 0. 1. 0.]]\n"
     ]
    }
   ],
   "source": [
    "print(A)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This representation should look familiar, no? "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1 0 0 0]\n",
      " [0 1 0 0]\n",
      " [0 0 0 1]\n",
      " [0 0 1 0]]\n"
     ]
    }
   ],
   "source": [
    "print(CNOT_1)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Just to double check,;"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "zero_zero becomes...\n",
      " [[1.]\n",
      " [0.]\n",
      " [0.]\n",
      " [0.]]\n",
      "zero_one becomes...\n",
      " [[0.]\n",
      " [1.]\n",
      " [0.]\n",
      " [0.]]\n",
      "one_zero becomes...\n",
      " [[0.]\n",
      " [0.]\n",
      " [0.]\n",
      " [1.]]\n",
      "one_one becomes...\n",
      " [[0.]\n",
      " [0.]\n",
      " [1.]\n",
      " [0.]]\n"
     ]
    }
   ],
   "source": [
    "for key, val in Psi.items():\n",
    "    print(key, 'becomes...\\n', A*val)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The action of i) and ii) are evidently the same then $\\square$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Approach 3"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"images/hadamard_action.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"750 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Starting with Qiskit:\n",
    "In order to run this notebook, one must first download the Quantum Information Software Kit (Qiskit) library from IBM at https://github.com/Qiskit/qiskit-terra (as well as supplementary libraries numpy and SciPy and an up-to-date version of python). \n",
    "\n",
    "One ought to also sign up for an IBM Q Experience account at https://quantumexperience.ng.bluemix.net/qx/experience in order to generate an APIToken (go to My Account > Advanced) for accessing the backends provided by IBM. The account sign up and APIToken specifcation is not actually necessary since this notebook assumes use of the local qasm simulator for the sake of simplicity, but its recommended, as seeing your code executed on an actual quantum device in some other location is really quite amazing and one of the unique capabilities of the Qiskit library."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "# import necessary libraries\n",
    "import numpy as np\n",
    "from pprint import pprint\n",
    "\n",
    "# import Qiskit\n",
    "from qiskit import execute, Aer, IBMQ\n",
    "from qiskit.backends.ibmq import least_busy\n",
    "from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister\n",
    "from qiskit.tools.visualization import plot_histogram\n",
    "\n",
    "# useful additional packages\n",
    "from qiskit.tools.visualization import plot_histogram"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "IBMQ.load_accounts()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The final approach to showing equivalence of the presented circuit diagrams is to implement the Qiskit library in order to compute and  measure the final state. This is done by creating instances of classes in python that represent a circuit with a given set of registers and then using class methods on these circuits to make the class equivalent of gate operations on the qubits. The operations are then executed using a method that calls a backend, i.e. some computing machine invisible to the programmer, to perform the computation and then stores the results. The backend can either be a classical simulator that attempts to mimick the behavior of a quantum circuit as best as it can or an actual quantum computer chip in the dilution refrigerators at the Watson research center.  \n",
    "\n",
    "In reading this notebook, one ought to dig around in the files for Qiskit to find the relevant class and method definitions -- the particularly relevant ones in this notebook will be QuantumCircuit, ClassicalRegister, QuantumRegister, execute, Aer and IBMQ), so take some time now to read through these files."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit i)\n",
    "For i), the initial state of the input is represented by the tensor product of the two input qubits in the initial register. This is given by:\n",
    "\n",
    "$$\\left|\\Psi\\right> = \\left|\\psi_1\\right> \\otimes \\left|\\psi_2\\right> = \\left|\\psi_2\\psi_1\\right>$$\n",
    "\n",
    "Where each $\\left|\\psi\\right>$ can be either $\\left|0\\right>$ or $\\left|1\\right>$\n",
    "\n",
    "*Note the convention change in the order of qubits in the product state representation on the right -- see appendix notebook under 'Reading a circuit diagram' for why there is a discrepancy here. This notebook will follow the above for consistency with IBM's documentation, which follows the same convention: (https://quantumexperience.ng.bluemix.net/qx/tutorial?sectionId=beginners-guide&page=006-Multi-Qubit_Gates~2F001-Multi-Qubit_Gates)*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "# This initial state register\n",
    "# can be realized in python by creating an instance of the \n",
    "# Qiskit quantum register of 2 qubits \n",
    "# and 2 classical ancilla bits for measuring the states\n",
    "\n",
    "n = 2\n",
    "i_q = QuantumRegister(n, name=\"i_q\")\n",
    "i_c = ClassicalRegister(n, name=\"i_c\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<IBMQBackend('ibmqx4') from IBMQ()>,\n",
       " <IBMQBackend('ibmqx5') from IBMQ()>,\n",
       " <IBMQBackend('ibmqx2') from IBMQ()>,\n",
       " <IBMQBackend('ibmq_16_melbourne') from IBMQ()>,\n",
       " <IBMQBackend('ibmq_qasm_simulator') from IBMQ()>]"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "IBMQ.available_backends() #check backends - if you've set up your APIToken properly you\n",
    "#should be able to see the quantum chips and simulators at IBM"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "https://github.com/Qiskit/qiskit-backend-information/tree/master/backends -- follow this url for background on how the quantum chips/simulators work.\n",
    "*Note: when working with the quantum chip backends, especially when applying CNOTs, be sure to check documentation on the allowed two-qubit gate configurations.*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ibmqx4\n",
      "{'pending_jobs': 1, 'name': 'ibmqx4', 'operational': True}\n",
      "ibmqx5\n",
      "{'pending_jobs': 8, 'name': 'ibmqx5', 'operational': False}\n",
      "ibmqx2\n",
      "{'pending_jobs': 0, 'name': 'ibmqx2', 'operational': False}\n",
      "ibmq_16_melbourne\n",
      "{'pending_jobs': 6, 'name': 'ibmq_16_melbourne', 'operational': True}\n",
      "ibmq_qasm_simulator\n",
      "{'pending_jobs': 0, 'name': 'ibmq_qasm_simulator', 'operational': True}\n"
     ]
    }
   ],
   "source": [
    "for backend in IBMQ.available_backends(): #check backend status\n",
    "    print(backend.name())\n",
    "    pprint(backend.status())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Throughout the notebook, we'll need to evaluate the final state of a given the circuit and display the results, so let's define a function for this:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "def execute_and_plot(circuits, backend = Aer.get_backend('qasm_simulator')):\n",
    "    \"\"\"Executes circuits and plots the final \n",
    "    state histograms the for each circuit.\n",
    "    Adapted from 'execute_and_plot' function\n",
    "    in the beginners_guide_composer_examples\n",
    "    notebook provided in IBM's Qiskit\n",
    "    tutorial library on GitHub.\n",
    "    \n",
    "    Args:\n",
    "        circuits (list): list of circuits to execute\n",
    "        backend (string): allows for specifying the backend \n",
    "        to execute on. Defaults to local qasm simulator\n",
    "        downloaded with Qiskit library, but can be specified\n",
    "        to run on an actual quantum chip by using the string\n",
    "        names of the available backends at IBM.\n",
    "    \"\"\"\n",
    "    # Store the results of the circuit implementation\n",
    "    # using the .execute() method\n",
    "    results = execute(circuits, backend = backend).result()\n",
    " \n",
    "    plot_histogram(results.get_counts()) \n",
    "    # .get_counts():\n",
    "    # method returns a dictionary that maps each possible\n",
    "    # final state to the number of instances of \n",
    "    # said state over n evaluations \n",
    "    # (n defaults to 1024 for local qasm simulator),\n",
    "    # where multiple evaluations are a necessity since\n",
    "    # quantum computation outputs are probability\n",
    "    # dependent"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Note: when working with the quantum chip backends, especially when applying CNOTs, be sure to check documentation on the allowed two-qubit gate configurations at: https://github.com/Qiskit/qiskit-backend-information/tree/master/backends . This program assumes use of the local qasm simulator."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Creating a QuantumCircuit, QuantumRegister and ClassicalRegister allows us to build up a set of operations to apply to this circuit through class methods and then execute this set of operations, so lets do this for each possible input state and read out the end result."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAEyVJREFUeJzt3X2wXVV5x/HvQwIqkCIhQQM3ETBhMAYc5EKhOghizIua9MVWYiWGt5RUTKfWOvSF0KDt+NJWbQX0ioEERwEVISPhZUbMAGKQRAUNDCVFNDdEAQlhVBSwT/84J/Fwsm7OPTfn7nMTvp+ZO9l77XXOfu5MJr/stfZeOzITSZKa7dXtAiRJI5MBIUkqMiAkSUUGhCSpyICQJBUZEJKkokoCIiKWRcRjEfGjAY7/ZUTcV/+5KyJeV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9HWiKGk4RcTazOztdh3SUFU1xNQPTGzY7wEeHahPRIwGDgCerKQ6SdIOqgqIe4ApEXF4ROwDnA6sbOqzEnhvffudwG2ZucMVhCSpGpUMMdXnFM4HbgFGAcsyc31EXAyszcyVwBeAqyJiA7Urh9OrqE0aRg6FarcW/iddklTik9SSpCIDQpJUZEBIkooMCKlDtj357woA2lMYEFKHZGZGxP7enq09hXcxSR0QEa8B3gG8i9pDnquAG4E7M/NX3axNGioDQuqAiFgN/By4BhhD7WHP44CfAUsy8xsREV5daHdiQEi7KCIOBh7OzP2b2v8A+CC1hz7PzMxvd6M+aaicg5B23UuBeyLi7Y2Nmfl0Zi6htnz9uRGxd1eqk4bIgJB23Ubg28BFEfHXEfHaiHhZw/H1wNTMfK475UlDU9Vy39Ieq3730kXA/wEnA0cBmyPiGWoT1rOBL3axRGlInIOQdkFEHEntBVYHULsifzXwEmrL1z8BvBa4FPhKZv6uW3VKQ2FASLsgIh4A7gCeBrYAB1J7r8lvgb7MvLOL5Um7xICQhigiZgCXZObk+v5oaq/OPQ54G7WgWJCZzS/HknYLTlJLQ7cf8POImAi1955k5k8y8zrgQmqvzJ3RzQKlXWFASEP3dWoPwv13RBzReKB+1fC/wIndKEzqBANCGqL6U9H/SO1uwB9ExB0R8TcRcXT9DYpzgCu6WqS0C5yDkDogIl4PzAX+FJgA3AbcnJnLulqYtAsMCKnD6g/J7ZOZW7tdi7QrDAhJUpFzEJKkIgNCklRkQEiSigwISVKRASFJKjIgJElFBoQkqej/ARon+VFtJZYnAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_i_00 = QuantumCircuit(i_q, i_c, name=\"cnot_i_00\") \n",
    "# Note: qubits are assumed by Qiskit\n",
    "# to be initialized in the |0> state\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_i_00.cx(i_q[0], i_q[1]) # Apply CNOT on line 2 controlled by line 1\n",
    "\n",
    "# Measure final state:\n",
    "cnot_i_00.measure(i_q[0], i_c[0]) # Write qubit 1 state onto classical ancilla bit 1\n",
    "cnot_i_00.measure(i_q[1], i_c[1]) # Write qubit 2 state onto classical ancilla bit 2\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_i_00)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "*Note: The set of circuit operations to be executed can also be specified through a 'QASM', or a string that contains the registers and the set of operators to apply. We can get this string for the circuit we just made through the `.qasm()` method. This is also helpful for checking our implementation of the circuit, as we can read off the operations and make sure they match up with the diagram*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "OPENQASM 2.0;\n",
      "include \"qelib1.inc\";\n",
      "qreg i_q[2];\n",
      "creg i_c[2];\n",
      "cx i_q[0],i_q[1];\n",
      "measure i_q[0] -> i_c[0];\n",
      "measure i_q[1] -> i_c[1];\n",
      "\n"
     ]
    }
   ],
   "source": [
    "print(cnot_i_00.qasm())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Continuing input by input,"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAEvtJREFUeJzt3X+wX3V95/HniyBtQRYNCQrcRLAJYxHpUC8srA6KmkLobrLtdndJqxRBo0wpu+t2HXZ2pRvsbmvbXduOqL21aKBTkVZXMjX8mFGptRgkaLUCw5JB2tyQXUAC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S4FpgLXAqsCHJqVO6XQbsqapVwHuB93RRmySprasriLOAHVX1UFU9DdwIrJ/SZz2wub/9Z8Drk6Sj+iRJUxze0XlOBHYO7E8C/3S6PlX1bJKngGOBxwc7JdkIbOzvfivJAwtSsXTgljHlv19pvuTAxlheMptOXQVE60qg5tCHqpoAJuajKGkhJdleVeOjrkOaq66GmCaBFQP7Y8Aj0/VJcjhwDPBEJ9VJkvbRVUDcDaxOcnKSI4CLgC1T+mwBfqm//fPAZ6pqnysISVI3Ohli6s8pXAHcBiwBrquqe5NcA2yvqi3AHwE3JNlB78rhoi5qkxaQQ6E6qMV/pEuSWnySWpLUZEBIkpoMCElSkwEhSWoyICRJTQaEJKnJgJDmSZKlSZ436jqk+WJASPMgyXLgFuCdSc5K8oIkh03pc9RoqpPmxoCQ5sclwCpgDfBx4KPA25K8PMmP9a8svpZk6QhrlIbik9TSPEiymd47T96d5KXApfTecXIU8Gl6qxWvqapZLbMsLQYGhDQPkvw4cFJVfXpK+7nAzwL/Drisqj48ivqkuTAgpHnWn3tIVX1voO17wNFV9e3RVSYNxzkIaWF8f+9Gkp8DbjUcdLDxCkI6AEnOBP498BngL6pqx8Cx7H2nSZIlg1cU0sHAgJAOQJJPAC+n91KsI4GHgTuBv6qq3UmOA95dVW8bXZXS3BgQ0hwlWULv2YePAQ8ArwR+AjgOeBb4Ar0J6ser6udGVac0V528UU46RB0BbAYeqqovAJ9P8mLgDOCn6IXFq4EzR1eiNHdeQUgHKMlhVfX9wTmHfvtG4Deq6tgRlifNmXcxSQeoqr7f/713Qjr9QyuAD46qLulAeQUhLZAky4C/r6rvjLoWaS4MCElSk0NMkqQmA0KS1GRASJKaDAhJUpMBIUlqMiAkSU3/H63L4+ClbkB9AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_i_01 = QuantumCircuit(i_q, i_c, name=\"cnot_i_01\")\n",
    "cnot_i_01.x(i_q[0]) # Set the 1st qubit to |1> by flipping \n",
    "# the initialized |0> with an X gate before implementing\n",
    "# the circuit \n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_i_01.cx(i_q[0], i_q[1]) # Apply CNOT controlled by line 1\n",
    "\n",
    "# Measure final state:\n",
    "cnot_i_01.measure(i_q[0], i_c[0])\n",
    "cnot_i_01.measure(i_q[1], i_c[1])\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_i_01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAExJJREFUeJzt3X+QXWV9x/H3lwAqkIIh4ecmgk0YjAGLLBSqgyBEktgmtrUtsRLDD1NSMa3WMvQHsUHb+qOt2pEfrogkOAqoFDIafsyIGaQQJFFBApMmA2g2RAEJOCgK0W//uDfxevPs3r2bu+duwvs1s7PnPOe593x3huGT8zznPCcyE0mSmu3R7QIkSaOTASFJKjIgJElFBoQkqciAkCQVGRCSpKJKAiIiro6IJyLiwQGO/2VEPFD/uTsiXldFXZKkgVV1BXENMGOQ448Cb8rMY4EPAX1VFCVJGtieVZwkM++MiCMGOX53w+4qoGeka5IkDW40zkGcB9zS7SIk6aWukiuIoYqI06gFxBsH6bMAWACw7777Hn/00UdXVJ0k7R7WrFnzVGZOaNVv1ARERBwLXAXMzMyfDNQvM/uoz1H09vbm6tWrK6pQknYPEfGDofQbFUNMETEJuBE4OzP/r9v1SJIquoKIiC8BpwLjI6If+CCwF0BmXgksBg4ELo8IgK2Z2VtFbZK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uI8YDZwBrAe+BZwD/CNzPxxN2uThsOAkDogIg4DHgTeC9wBnApMB14HPAdckpl3RkS4QoB2FQaE1AER8T5gVmZOb2o/GPhHalcVp2fmj7pRnzQcTlJLnXEvsF9E/F5jY2b+ODP/BlgLnN2VyqRhMiCkzvge8ChwZURcFBGvj4iXNxzvAZ7vTmnS8DjEJHVIRLwCeA9wErCV2tzDHtTuFjwBOD4zf969CqX2GBBSh0XECcDJwEHAAdSC4srMfKybdUntMiCknVAPg7+ldufSXZm5ruHYyzLzl9t+d61IaZgMCGknRMSNwGupvRRrH+AHwCpqYbEpIg4BFmfmX3exTGlYDAhpmCJiDHALcD2wDjgeeA21oaWt1ILibcBTmfkn3apTGi6X2pCGb29gKfBIZt4D3FW/YjgOeD1wNPBGahPU0i7HKwhpJ0XEHpn56+anpCNiAfDvmXlgF8uThs3nIKSdlJm/rv9OgIiI+qGJwJXdqkvaWV5BSCMkIsYDP8tMH5DTLsmAkCQVOcQkSSoyICRJRQaEJKnIgJAkFRkQkqQiA0KSVPT/tqEAGRluIccAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_i_10 = QuantumCircuit(i_q, i_c, name=\"cnot_i_10\")\n",
    "cnot_i_10.x(i_q[1]) # Set the 2nd qubit to |1>\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_i_10.cx(i_q[0], i_q[1]) # Apply CNOT controlled by line 1\n",
    "\n",
    "# Measure final state:\n",
    "cnot_i_10.measure(i_q[0], i_c[0])\n",
    "cnot_i_10.measure(i_q[1], i_c[1])\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_i_10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAA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hzd4ngL8C/neSUwcPVNUjwJ8D54yiMGkuGBDSLPVfifsr9N7M+JUkn0vy75Kc2X+D4irgxpEWKR0A5yCkOZDkFcBqenMPJwCfBrZW1Q0jLUw6AAaENMeS/BC9ZyKeGnUt0oEwICRJTc5BSJKaDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDUZEJKkpv8PVjfs7B8HhLsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_i_11 = QuantumCircuit(i_q, i_c, name=\"cnot_i_11\")\n",
    "cnot_i_11.x(i_q[0]) # Set the 1st qubit to |1>\n",
    "cnot_i_11.x(i_q[1]) # Set the 2nd qubit to |1>\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_i_11.cx(i_q[0], i_q[1]) # Apply CNOT controlled by line 1\n",
    "\n",
    "# Measure final states:\n",
    "cnot_i_11.measure(i_q[0], i_c[0])\n",
    "cnot_i_11.measure(i_q[1], i_c[1])\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_i_11)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reading these off, we have $[\\Psi = \\left|00\\right>,\\left|10\\right>,\\left|01\\right>,\\left|11\\right>]\\rightarrow [\\Psi' = \\left|00\\right>,\\left|10\\right>,\\left|11\\right>,\\left|01\\right>]$. \n",
    "\n",
    "Note that this is the same answer (up to convention in product-state notation) as obtained for approaches 1 and 2, only this time we have had a far less tedious time of writing out logic operations or matrices thanks to the Qiskit library abstracting much of this away for us. While the numpy library was helpful for making linear algebra operations, the matrices had to be user defined and this method does not have nearly the scalability or ease of computation that Qiskit offers."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Circuit ii)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [],
   "source": [
    "# For circuit ii, we can again create a quantum register of size \n",
    "# 2 with 2 classical ancilla bits for measurement\n",
    "\n",
    "n = 2\n",
    "ii_q = QuantumRegister(n, name=\"ii_q\")\n",
    "ii_c = ClassicalRegister(n, name=\"ii_c\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[<IBMQBackend('ibmqx4') from IBMQ()>,\n",
       " <IBMQBackend('ibmqx5') from IBMQ()>,\n",
       " <IBMQBackend('ibmqx2') from IBMQ()>,\n",
       " <IBMQBackend('ibmq_16_melbourne') from IBMQ()>,\n",
       " <IBMQBackend('ibmq_qasm_simulator') from IBMQ()>]"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "IBMQ.available_backends() #check backends - if you've set up your APIToken properly you\n",
    "#should be able to see the quantum chips and simulators at IBM"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "ibmqx4\n",
      "{'pending_jobs': 0, 'name': 'ibmqx4', 'operational': True}\n",
      "ibmqx5\n",
      "{'pending_jobs': 8, 'name': 'ibmqx5', 'operational': False}\n",
      "ibmqx2\n",
      "{'pending_jobs': 0, 'name': 'ibmqx2', 'operational': False}\n",
      "ibmq_16_melbourne\n",
      "{'pending_jobs': 6, 'name': 'ibmq_16_melbourne', 'operational': True}\n",
      "ibmq_qasm_simulator\n",
      "{'pending_jobs': 0, 'name': 'ibmq_qasm_simulator', 'operational': True}\n"
     ]
    }
   ],
   "source": [
    "for backend in IBMQ.available_backends(): #check backend status\n",
    "    print(backend.name())\n",
    "    pprint(backend.status())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now for executing circuit ii):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'cnot_ii_01' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-25-d3dead6008f3>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[0;32m      1\u001b[0m \u001b[1;31m# Initialize circuit:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      2\u001b[0m \u001b[0mcnot_ii_00\u001b[0m \u001b[1;33m=\u001b[0m \u001b[0mQuantumCircuit\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mii_q\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mii_c\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mname\u001b[0m\u001b[1;33m=\u001b[0m\u001b[1;34m\"cnot_ii_00\"\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[1;32m----> 3\u001b[1;33m \u001b[0mcnot_ii_01\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mx\u001b[0m\u001b[1;33m(\u001b[0m\u001b[0mii_q\u001b[0m\u001b[1;33m[\u001b[0m\u001b[1;36m0\u001b[0m\u001b[1;33m]\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m      4\u001b[0m \u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0;32m      5\u001b[0m \u001b[1;31m# Apply gates according to diagram:\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n",
      "\u001b[1;31mNameError\u001b[0m: name 'cnot_ii_01' is not defined"
     ]
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_ii_00 = QuantumCircuit(ii_q, ii_c, name=\"cnot_ii_00\")\n",
    "cnot_ii_01.x(ii_q[0])\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel. \n",
    "# Note that specifying a register (rather than a qubit)\n",
    "# for some gate method argument applies the gate to all\n",
    "# qubits in the register\n",
    "cnot_ii_00.cx(ii_q[1], ii_q[0]) # Apply CNOT controlled by line 2\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel.\n",
    "\n",
    "# Measure final state:\n",
    "cnot_ii_00.measure(ii_q[0], ii_c[0])\n",
    "cnot_ii_00.measure(ii_q[1], ii_c[1])\n",
    "\n",
    "# Display final state probabilities\n",
    "execute_and_plot(cnot_ii_00)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAEwZJREFUeJzt3X+wX3V95/HniyBrQYoGggI3EdiEuizQ0V5ZWLsoKoXQ3aTd7bakqykIZmVK2Vm367DdlW6wu1Pb3Wp3RW1qwQRHkdYfZGoIdKuMthok8VcFhiVF2lxIC0jAcasF7Hv/+H5Dv958bu793tx7vjfx+Zi5k3M+5/P9nvedyeSV8/mc8zmpKiRJmuywURcgSVqYDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDV1EhBJbkjyaJKvT3H83yT5Wv/n80l+tIu6JElT6+oK4oPARfs5/g3g1VV1FvAOYEMXRUmSpnZ4Fyepqs8mOXk/xz8/sLsNGJvvmiRJ+7cQ5yAuB24bdRGS9IOukyuImUpyPr2A+PH99FkHrAM46qijfuxlL3tZR9VJ0qFhx44dj1fVkun6LZiASHIW8AFgZVV9c6p+VbWB/hzF+Ph4bd++vaMKJenQkOQvZtJvQQwxJVkGfBx4Y1X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FCoDmrxP+mSpBafpJYkNRkQkqQmA0KS1GRASJKaDAhJUpMBIXWkv2ildNDwNldpDiR5N711lz5UVQ8NtB9WVX83ssKkA+AVhHSAkrwYuBq4FPjzJF9IcnmSF+0NhyQfTvLTo6xTGpYBIR241wJ/BJxGb5XMO4F3AI8k+USSVfRWBvj6yCqUZsEhJukAJVlOb/n6P6qqRwfaz6F3VbEO+NOq+mejqVCaHQNCmgNJDgOOqKrvNo5tB26squu7r0yaPQNCOgBJfgS4AlhCb8j2MWAr8H+qqpIc22/74ar69ugqlYZnQEgHIMl9wOeAJ4GngJOBU4GHgN/qr1r8/NaVhbTQGRDSLCW5ELi+qpb39xcBJwCvAP4lvdfoXlZVE6OrUpo972KSZu8o4K+TLAWoqu9V1UT//Sa/AvwdcMEoC5QOhAEhzd4ngL8C/neSUwcPVNUjwJ8D54yiMGkuGBDSLPVfifsr9N7M+JUkn0vy75Kc2X+D4irgxpEWKR0A5yCkOZDkFcBqenMPJwCfBrZW1Q0jLUw6AAaENMeS/BC9ZyKeGnUt0oEwICRJTc5BSJKaDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDUZEJKkpv8PVjfs7B8HhLsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuit:\n",
    "cnot_ii_01 = QuantumCircuit(ii_q, ii_c, name=\"cnot_ii_01\")\n",
    "cnot_ii_01.x(ii_q[0]) # Set the 1st qubit to |1>\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "cnot_ii_01.cx(ii_q[1], ii_q[0]) # Apply CNOT controlled by line 2\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "\n",
    "# Measure final state:\n",
    "cnot_ii_01.measure(ii_q[0], ii_c[0])\n",
    "cnot_ii_01.measure(ii_q[1], ii_c[1])\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_ii_01)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAEvtJREFUeJzt3X+wX3V95/HniyBtQRYNCQrcRLAJYxHpUC8srA6KmkLobrLtdndJqxRBo0wpu+t2HXZ2pRvsbmvbXduOqL21aKBTkVZXMjX8mFGptRgkaLUCw5JB2tyQXUACjlUL6Hv/+H5Dv958bu793tx7vjfx+Zi5c8/5nM/3e953huGV8/mc8zmpKiRJmuqwURcgSVqcDAhJUpMBIUlqMiAkSU0GhCSpyYCQJDV1EhBJrkvyaJKvTXP8F5N8tf9zZ5Kf7KIuSdL0urqC+AhwwX6Ofx14TVWdDrwbmOiiKEnS9A7v4iRV9bkkJ+3n+J0Du9uAsYWuSZK0f4txDuIy4JZRFyFJP+w6uYKYrSTn0QuIV++nz0ZgI8BRRx31ype97GUdVSdJh4Z77rnn8apaPlO/RRMQSU4HPgSsrapvTNevqiboz1GMj4/X9u3bO6pQkg4NSf52Nv0WxRBTkpXAJ4A3VdX/GXU9kqSOriCSfBR4LbAsySTwa8DzAKrqg8DVwLHA+5MAPFtV413UJklq6+oupg0zHH8L8JYuapEkzc6iGGKSJC0+BoQkqcmAkCQ1GRCSpCYDQpLUZEBIkpoMCElSkwEhSWoyICRJTQaEJKnJgJAkNRkQkqQmA0KahUsvvZTjjjuO0047rXm8qrjyyitZtWoVp59+Ol/60peeO7Z582ZWr17N6tWr2bx583Pt99xzD694xStYtWoVV155JVW14H+HNAwDQpqFSy65hFtvvXXa47fccgsPPvggDz74IBM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2nSZIlg1cU0sHAgJAOQJJPAC+n91KsI4GHgTuBv6qq3UmOA95dVW8bXZXS3BgQ0hwlWULv2YePAQ8ArwR+AjgOeBb4Ar0J6ser6udGVac0V528UU46RB0BbAYeqqovAJ9P8mLgDOCn6IXFq4EzR1eiNHdeQUgHKMlhVfX9wTmHfvtG4Deq6tgRlifNmXcxSQeoqr7f/713Qjr9QyuAD46qLulAeQUhLZAky4C/r6rvjLoWaS4MCElSk0NMkqQmA0KS1GRASJKaDAhJUpMBIUlqMiAkSU3/H63L4+ClbkB9AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuits\n",
    "cnot_ii_10 = QuantumCircuit(ii_q, ii_c, name=\"cnot_ii_10\")\n",
    "cnot_ii_10.x(ii_q[1]) # Set the 2nd qubit to |1>\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "cnot_ii_10.cx(ii_q[1], ii_q[0]) # Apply CNOT controlled by line 2\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "\n",
    "# Measure final state:\n",
    "cnot_ii_10.measure(ii_q[0], ii_c[0])\n",
    "cnot_ii_10.measure(ii_q[1], ii_c[1])\n",
    "\n",
    "# Display final state probabilities:\n",
    "execute_and_plot(cnot_ii_10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAExJJREFUeJzt3X+QXWV9x/H3l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
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Initialize circuits:\n",
    "cnot_ii_11 = QuantumCircuit(ii_q, ii_c, name=\"cnot_ii_11\")\n",
    "cnot_ii_11.x(ii_q[0]) # Set the 1st qubit to |1>\n",
    "cnot_ii_11.x(ii_q[1]) # Set the 2nd qubit to |1>\n",
    "\n",
    "# Apply gates according to diagram:\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "cnot_ii_11.cx(ii_q[1], ii_q[0]) # Apply CNOT controlled by line 2\n",
    "cnot_ii_00.h(ii_q) # Apply hadamards in parallel\n",
    "\n",
    "# Measure final state\n",
    "cnot_ii_11.measure(ii_q[0], ii_c[0])\n",
    "cnot_ii_11.measure(ii_q[1], ii_c[1])\n",
    "\n",
    "# Display final state probabilities\n",
    "execute_and_plot(cnot_ii_11)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Reading off the computed final state, we see that it matches the computed final state of i), and so the circuits are considered equivalent $\\square$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<hr>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Another implementation:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The input-by-input approach is helpful for first steps in understanding Qiskit, but is also more long-winded than necessary. For a solution to the problem that uses Qiskit more concisely/cleverly:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "metadata": {},
   "outputs": [],
   "source": [
    "def circuit_i():\n",
    "    i_q = QuantumRegister(2, name='i_q')\n",
    "    i_c = ClassicalRegister(2, name='i_c')\n",
    "    initial_states = ['00','01','10','11']\n",
    "    initial_circuits = {state: QuantumCircuit(i_q, i_c, name='%s'%(state)) \\\n",
    "                       for state in initial_states}\n",
    "    final_circuits = {}\n",
    "    for state in initial_states:\n",
    "        if state[0] is '1':\n",
    "            initial_circuits[state].x(i_q[0])\n",
    "        if state[1] is '1':\n",
    "            initial_circuits[state].x(i_q[1])\n",
    "            \n",
    "        initial_circuits[state].cx(i_q[0], i_q[1]) \n",
    "        \n",
    "        initial_circuits[state].measure(i_q[0], i_c[0])\n",
    "        initial_circuits[state].measure(i_q[1], i_c[1])\n",
    "        final_circuits[state] = initial_circuits[state]\n",
    "    return initial_circuits"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "def circuit_ii():\n",
    "    ii_q = QuantumRegister(2, name='ii_q')\n",
    "    ii_c = ClassicalRegister(2, name='ii_c')\n",
    "    initial_states = ['00','01','10','11']\n",
    "    circuits = {state: QuantumCircuit(ii_q, ii_c, name='%s'%(state)) \\\n",
    "                       for state in initial_states}\n",
    "    for state in initial_states:\n",
    "        if state[0] is '1':\n",
    "            circuits[state].x(ii_q[0])\n",
    "        if state[1] is '1':\n",
    "            circuits[state].x(ii_q[1])\n",
    "            \n",
    "        circuits[state].h(ii_q)\n",
    "        circuits[state].cx(ii_q[1], ii_q[0])\n",
    "        circuits[state].h(ii_q)\n",
    "        \n",
    "        circuits[state].measure(ii_q[0], ii_c[0])\n",
    "        circuits[state].measure(ii_q[1], ii_c[1])\n",
    "    return circuits"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [],
   "source": [
    "i = circuit_i()\n",
    "ii = circuit_ii()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 36,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Use the IBMQ Quantum Experience\n",
    "backend = least_busy(IBMQ.backends())\n",
    "\n",
    "# Use local qasm simulator\n",
    "# backend = Aer.get_backend('qasm_simulator')\n",
    "\n",
    "results_i = execute(list(i.values()), backend=backend).result()\n",
    "results_ii = execute(list(ii.values()), backend=backend).result()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 37,
   "metadata": {},
   "outputs": [],
   "source": [
    "results_i_mapping = {circuit: results_i.get_counts(circuit) for circuit in list(results_i.get_names())}\n",
    "results_ii_mapping = {circuit: results_ii.get_counts(circuit) for circuit in list(results_ii.get_names())}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 38,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'00': {'00': 941, '01': 29, '10': 41, '11': 13}, '01': {'00': 101, '01': 15, '10': 865, '11': 43}, '10': {'00': 25, '01': 76, '10': 116, '11': 807}, '11': {'00': 143, '01': 835, '10': 21, '11': 25}}\n",
      "{'00': {'00': 957, '01': 33, '10': 25, '11': 9}, '01': {'00': 94, '01': 16, '10': 886, '11': 28}, '10': {'00': 30, '01': 85, '10': 129, '11': 780}, '11': {'00': 125, '01': 852, '10': 23, '11': 24}}\n"
     ]
    }
   ],
   "source": [
    "print(results_i_mapping)\n",
    "print(results_ii_mapping)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "results_i\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAG0hJREFUeJzt3XuYFPWd7/H3FybALiBGB6MwIMKAy1WREZfjJQJyQMyOaw6ruFkkQkIwkjXkGG/rgkf2HCC65nJAVqJukKxMFBSIAuqKGIw38IgIY4zzKMqAK8gKCLtcZvieP6pntqepobuZnqqm+byeh2eqq35T9e2KmU9V/ap+Ze6OiIhIqhZxFyAiIvlJASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioYriLqApiouLvVu3bnGXISJyQnnrrb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bt3p2/fvlmtUwqLAkIi05Sj2uLiYn7729/y7rvvsmDBAsaNGwdATU0Nt9xyCy+99BIbN25kwIABzJkzJ/Lvlm+2bdtGly5d6j+XlJSwbdu2RtsUFRXRoUMHdu3axf79+5k9ezbTp0/Pep1SWBQQEpmmHNUOHDiQTp06AdC3b18OHDjAwYMHcXfcnf379+Pu7N27t77dyazuTCCZmWXUZvr06UydOpV27dplvU4pLEVxFyAnj7Aj0DfeeKPRNslHtcXFxfVtlixZwsCBA2ndujUA8+bNo3///rRt25aePXsyd+7cCL5NfispKWHr1q31n6urq48Kzro2JSUl1NTUsGfPHk477TTeeOMNFi9ezG233cbu3btp0aIFbdq0YdCgQWnXKYVFZxASmaYc1dbZvHkzt99+Ow899BAAhw8fZt68ebz99tts376dAQMGMHPmzBxXfuK58MIL+eCDD/joo484dOgQFRUVlJeXN2hTXl7OggULAFi8eDHDhg3DzFi7di1btmxhy5Yt/PCHP+Suu+5iypQpGa3zZHW8fWu7du1i6NChtGvXjilTpjT4nVGjRnHeeefRt29fJk+eTG1tbRRfpQEFhEQmm6NaoMFRbV37a665hscee4wePXoAsGHDBgB69OiBmXHttdfy6quvRvF18lpRURFz5sxh5MiR9O7dm2uvvZa+ffsybdo0li9fDsDEiRPZtWsXpaWlPPDAA2lvW21snSe7pvSttWnThhkzZjS4lbjOE088wTvvvMOmTZvYuXMnTz75ZCTfJ5kuMUlkko9AO3fuTEVFBY8//niDNnVHtUOGDGlwVLt7926uuuoqZs6cycUXX1zfvnPnzlRWVrJz5046duzICy+8QO/evaP+anlp9OjRjB49usG8e++9t366TZs2af/o3HPPPWnXebJL7lsD6vvW+vTpU99m2bJl9ftyzJgxTJkyBXenbdu2XHLJJVRVVR213lNOOQUIDpQOHToUS3+PziAkMk05qp0zZw5VVVXMmDGD888/n/PPP58dO3bQqVMnpk+fzmWXXcaAAQPYsGEDd911V5xfU04yTbljLJ2RI0dyxhln0L59e8aMGZPbwjOgMwiJ1PEe1d59993cfffdoeucPHkykydP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rwCuJM4aBBJf0/gy4hKCDWpom3b7uTZ7va51BZMjMLgCuJrgmfhbBH69V7v5orIUVGO3naNQNXZL6lLSZTQJmuvvpMZZXUE7kfa2AOA6JWwNbufueuGspZNrP0an742VmMwge2Pq7uGsqVCfSvlZAiEg9MysG9rv7f8ZdS6E7Efa1AkJERELpNlcREQmlgBARkVAKCBERCaWAEBGRUAoIEREJpYAQEZFQ/x+7Rk6eK+BxwQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAG8hJREFUeJzt3X94FeWd9/H3N6SUXYM/gVYIGGmAhaCiBq3Uy4LSIrjGVVxBW38AQtc1XcVuqbW7wKq7K11/tqAtVldFCypa4NGIsqiPSlUIFauEuuaC1ARdFB5FxUVI/D5/zEk8nEw455CTmXD4vK7LK3Nm7nPOd0bNJ3PPPfeYuyMiIpKqIO4CRESkc1JAiIhIKAWEiIiEUkCIiEgoBYSIiIRSQIiISCgFhIiIhFJAiIhIKAWEiIiEiiQgzOxeM3vfzN5sY7uZ2S/MrNbM/mhmJ0RRl4iItK0wou+5D5gLPNDG9rHAgMQ/JwN3JX7uVY8ePbykpCQ3FYqIHCDWrl271d17pmsXSUC4+wtmVrKXJucAD3gwMdQrZnaomR3p7u/t7XNLSkqorq7OYaUiIvnPzP6cSbvOcg2iD1Cf9LohsU5ERGLSWQLCQtaFTjNrZtPMrNrMqj/44IMOLktE5MDVWQKiAeib9LoYeDesobvPd/dydy/v2TNtF5qIiOyjzhIQy4BLEqOZvglsT3f9QUREOlYkF6nNbCEwEuhhZg3ALOArAO7+K6AKGAfUAp8Bk6KoS0RE2hbVKKYL02x34MooahERkcx0li4mERHpZBQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAieWr58uUMGjSI0tJSbrrpplbb33nnHUaNGsXxxx/PscceS1VVVavtRUVF3HzzzS3rSkpKOOaYYxg2bBjl5eUdvg8Sr6ieKCciEWpqauLKK69kxYoVFBcXM3z4cCoqKhgyZEhLmxtvvJELLriAK664gpqaGsaNG0ddXV3L9unTpzN27NhWn/3cc8/Ro0ePKHZDYqYzCJE8tHr1akpLS+nfvz9du3Zl4sSJLF26dI82ZsbHH38MwPbt2+ndu3fLtiVLltC/f3/KysoirVs6FwWESB7avHkzfft++YiV4uJiNm/evEeb2bNn8+CDD1JcXMy4ceP45S9/CcCOHTuYM2cOs2bNavW5ZsZ3v/tdTjzxRObPn9+xOyGxU0CI5KFgguQ9me354MaFCxdy2WWX0dDQQFVVFRdffDFffPEFs2bNYvr06RQVFbX6jFWrVvGHP/yBp556innz5vHCCy902D5I/HQNQiQPFRcXU1//5WPeGxoa9uhCArjnnntYvnw5AKeccgo7d+5k69atvPrqqyxevJgZM2bw0UcfUVBQQLdu3aisrGz5jF69enHuueeyevVqTjvttOh2TCKlMwiRPDR8+HDefvttNm3axK5du1i0aBEVFRV7tOnXrx8rV64EYMOGDezcuZOePXvy4osvUldXR11dHVdffTXXXXcdlZWV7Nixg08++QQIuqGeeeYZhg4dGvm+SXR0BiGShwoLC5k7dy5jxoyhqamJyZMnU1ZWxsyZMykvL6eiooJbbrmFqVOnctttt2Fm3Hfffa26oZJt2bKFc889F4DGxkYuuugizjzzzKh2SWJgYX2V+4vy8nKvrq6OuwwRkf2Kma1197Q3sqiLSUREQikgREQklAJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSU5mISySMl1z4Z6/fX3XRWrN8vuaUzCBERCaWAEBGRUAoIEREJpYA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yZGYnAOcQ9IkfSfDLa7m73xtrYXlGxzkazVOXpN4lbWbTgH939yNiLC+v7M/HWgGxDxJDA7u6+/a4a8lnOs7Raf7lZWY3ENyw9bO4a8pX+9OxVkCISAsz6wHscPf/jbuWfLc/HGsFhIiIhNIwVxERCaWAEBGRUAoIEREJpYAQEZFQCggREQmlgBARkVD/HzoMP46QfE29AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAGnVJREFUeJzt3XuYXHWd5/H3NwnBgXARg0DohAABDCExSIOyKHLRJYg2Axsh6DAIUVgH0MUL4IxGFmYXdHbAmSfIEBWBqGnuJiiXZQgXuSdZGiSNkX4gTDph5LJcFkZy87t/VKXtdE7oKtJd1V15v56Hh3NO/U7Vt45Yn/6dc36/E5mJJEk9Dal3AZKkgcmAkCQVMiAkSYUMCElSIQNCklTIgJAkFTIgJEmFDAhJUiEDQpJUyICQJBUaVu8CNsXIkSNz7Nix9S5DkgaVRYsWvZyZO/bWblAHxNixY1m4cGG9y5CkQSUinq+knaeYJEmFDAhJUiEDQpJUyICQJBUyICRJhQwISVIhA0KSVMiAkCQVMiAkSYUMCElSIQNCklTIgJAkFTIgJEmFDAhJUiEDQpJUyICQpE10xx13sM8++zBu3DguueSSDV4/55xzmDx5MpMnT2bvvfdm++2373rt3HPPZcKECYwfP56vfOUrZCYAc+bMYeLEiUyaNIkpU6bw8ssv1+z7rGNASNImWLt2LWeeeSa333477e3tzJkzh/b29vXaXHbZZbS1tdHW1sbZZ5/N8cc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sA3wR2JHScX4JuAP41/Ltxe8rb9s2M9+sX6WNpdwTPhP4CLCG0rWHIZQm8jwQOCAz/6N+FTae8h9B0f33IiLWAtsMtGNtQPQiIp6mdGfHG8CrwHspPdhoJTArMx+oY3kNo9txfo3S42bHUvrLdilwaXl6+PcU9Sy06SLiQOBg4P3A9pSC4l+630mmvlEOiFx3bScijqfUezimvpVtyIB4BxFxFHB5Zo4rrw+j9OzsA4BjKAXFFzKz59PxVIWC4zwU2AX4EHA8pWN+amZ21q/KxlEOg/9G6c6lBzJzSbfXtszMlev+XbciG0SPY31fZnZ0ey26hcSAHNvjRep3tjXwh4gYDaUHH2Xm85l5M/AdSoOLjqpngQ2i53FeW75IPQ/4W+BPlO7+UN/4FtBM6eL/xRFxWUScGBG7lsNhZ+Cy+pbYMLof6+9HxKURMTUidimfOn1/RFw5EMMB7EG8o/KcSzdSegre1zLz2R6v/xAYmpln1KO+RuFxrp1y7+x2SgM+l1DqDY+ndGppDfAI8JfAy5l5fL3qbAQVHOuHKV2gHrDHumZPlBuMygn/t8A/Am0R8QSlH7L5lG5Va6E0olqbwONcU8OBaygN/HwYeKDcY9if0im9DwAfpXSBWpumt2M9ngF+rO1BVCgiPgQcS+mc+C6UfrzuyMyr6lpYg/E418a6qUt6jpKOiNOBizPzfXUsr6EM5mNtQLwL5VsDh2fm6/WupZF5nGtn3Y9XRFxEacDW39W7pkY1mI61ASGpS0SMBN7KzD/Wu5ZGNxiOtQEhSSrkba6SpEIGhCSpkAEhSSpkQEiSChkQkqRCBoQkqdD/BxupzkW2vHc7AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0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/vKUl9Qc0uMfVlTU1NrFjxzjCNjo4Ohg4dWtG+TzzxBAsWLOC6667jjTfeYP369QwcOJAvfelLdHR0vKv3lKS+wIAAJkyYwLJly3jppZcYNmwYs2fP5o477qho39tvv33z8s0338yiRYs294IaNGgQTz75JIceeii33nor559/fq/UL0m9wUtMQP/+/Zk5cyaTJk3igAMOYMqUKYwdO5bp06czd26pM9VTTz1FU1MTd955J2effTZjx47t9n2vv/56zjjjDFpaWthvv/28QS1phxI7ct/81tbW3NRrSH1X88X31/Xzl191bF0/X+prImJxZrZ2184zCElSIQNCklRop71J7WUPSdo+zyAkSYUMCElSIQNCklTIgJAkFTIgJEmFDAhJUiEDQpJUyICQJBUyICRJhQwISVIhA0KSVMiAkCQVMiAkSYUMCElSIQNCkt6j+fPnM3r0aFpaWjY/k76zN998kxNPPJGWlhYOPfRQli9fDsDDDz/MwQcfzEEHHcTBBx/Mo48+utW+bW1tHHjggb39FQoZEFKD6o0frUsuuYThw4czcODAWn2NPm/jxo2ce+65PPDAAyxdupRZs2axdOnSLdrceOONfPCDH6S9vZ2vfOUrXHTRRQAMHjyYn/3sZzz77LPccsstTJs2bYv97rnnnroeawNCakC99aP12c9+loULF9b0u/R1CxcupKWlhZEjRzJgwACmTp3KnDlztmgzZ84cvvCFLwBwwgkn8Mgjj5CZjB8/nqFDhwIwduxY1q1bx5tvvgnAG2+8wdVXX803vvGN2n6hTgwIqQH11o/Wxz/+cfbee+/afpk+buXKlQwfPnzzelNTEytXrtxmm/79+7PHHnvw2muvbdHm7rvvZvz48ey6664AXHrppVxwwQW8//3v7+VvsG0GhNSAeutHS1vLzK22RURVbZYsWcJFF13ED37wAwCeeeYZ2tvbOf7443u42urstM+klhpZT/5oPfTQQz1fYANpampixYoVm9c7Ojo2n4F1bdPU1MSGDRtYs2YNe+655+b2xx9/PLfeeiv77bcfAE888QSLFy+mubmZDRs2sHr1ao444ggee+yxmn0v8AxCakjV/GgBFf1oqdiECRNYtmwZL730EuvXr2f27Nm0t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TFcADPILarPOfSXZSegvfVzHyxy+vXAf0y8+x61NcoPM61Uz47e4DSgM8XKJ0NH0Dp0tIG4Engr4BXM/Nz9aqzEVRwrJ+gdIO6zx7rmj1RbkdUTvi/A74DPBMRv6H0Q/Yopa5qbZRGVOs98DjX1ADgFkoDP58AHi+fMYyndEnvz4BPULpBrfemu2N9AH38WHsGUaGI+BhwHKVr4ntT+vGan5k31bWwBuNxro1NU5d0HSUdEWcBV2bmh+pYXkPZkY+1AfEulLsGDsjMNfWupZF5nGtn049XRMygNGDrknrX1Kh2pGNtQEjaLCIGA3/MzP+ody2Nbkc41gaEJKmQ3VwlSYUMCElSIQNCklTIgJAkFTIgJEmFDAhJUqH/D2tpu8PNxcaQAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "print('results_i')\n",
    "for circuit in list(results_i.get_names()):\n",
    "    plot_histogram(results_i.get_counts(circuit))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "results_ii\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAHBhJREFUeJzt3X90VeWd7/H3VyI4ClIVaCUJBgwwIQGCRNCrq4A/BsWZOIiDaGWspuL4ozO31FusP2ivTC+2UxW7wCpWR6RqqoIDRcR2oChQFMKISmBRUkEJOCCMUqkSCH7vH/skPTnskBxysk9y+LzWymKffZ6c/d279Xyy9/PsZ5u7IyIikuiEdBcgIiJtkwJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSUAkJEREJlpbuAlujWrZvn5eWluwwRkXZl3bp1e9y9e1Pt2nVA5OXlUVFRke4yRETaFTP7oDntdIlJRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSUAkJEREIpIGKWLFlC//79yc/P54EHHjji/Q8++ICLL76YQYMGMXLkSKqrq+vXDx06lOLiYgoLC3nsscfqf2fkyJH079+f4uJiiouL2b17d2T7IyLSYu7ebn+GDh3qqVBbW+t9+vTxP/7xj15TU+ODBg3yysrKBm2uvvpqf/rpp93dfenSpX799de7u3tNTY0fOHDA3d0/++wzP+uss3zHjh3u7j5ixAhfu3ZtSmoUEUkVoMKb8R0byRmEmT1lZrvNbEMj75uZ/czMqszsXTM7J4q66qxZs4b8/Hz69OlDx44dmTBhAgsWLGjQZuPGjVx88cUAjBo1qv79jh070qlTJwBqamr48ssvoyxdRKTVRHWJ6WngsqO8fznQN/YzCfh5BDXV27FjB7m5ufWvc3Jy2LFjR4M2gwcPZt68eQC8/PLLfPbZZ+zduxeA7du3M2jQIHJzc5kyZQo9e/as/70bb7yR4uJipk2bRhDcIiLtQyQB4e5vAP9zlCZXAs/Ezn7eBL5iZmdGURsQ+sVtZg1e//SnP+X1119nyJAhvP7662RnZ5OVFTzSOzc3l3fffZeqqirmzJnDrl27AHj22Wd57733WLFiBStWrGDu3LmtvzMiIinSVjqps4Htca+rY+sikZOTw/btf9l8dXV1g7MAgJ49ezJ//nzefvttfvSjHwHQtWvXI9oUFhayYsUKALKzg13o0qUL1113HWvWrGnN3RARSam2EhAWsi70eoyZTTKzCjOr+Pjjj1Oy8XPPPZctW7awdetWDh48SHl5OaWlpQ3a7Nmzp75/Yfr06dx0001AECZffPEFAJ988gmrVq2if//+1NbWsmfPHgAOHTrEokWLKCoqSkm9IiJRaCsBUQ3kxr3OAXaGNXT32e5e4u4l3bt3T8nGs7KymDl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zYB44CfHsN2qgmmB6+TQ/BM6zpdgCJguZltI3ju9UJ1VIuIpE9zAuJy4G/c/Xux5b89hu2sBfqaWW8z6whMABbWvenu+9y9m7vnuXse8CZQ6u4Vx7AtERFJgeYExCnu/hGAu28Huia7EXevBe4geH7EJuAFd680s/vNLPEpdSIi0gY0p5M6KzbNtzXymuZM+e3uiwkeWxq/bmojbUc2oy4REWlFzQmI3TQcpbQ34bUDfVJZlIiIpF+TARHrExARkeNMMndSi4jIcUQBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISKrKAMLPLzGyzmVWZ2V0h7082s41m9q6ZLTWzs6KqTUREjhRJQJhZB2AWcDkwALjWzAYkNHsbKHH3QcBLwE+iqE1ERMJFdQYxDKhy9/fd/SBQDlwZ38Ddf+fun8devgnkRFSbiIiEiCogsoHtca+rY+saUwa82qoViYjIUWVFtB0LWeehDc2uB0qAEY28PwmYBNCrV69U1SciIgmiOoOoBnLjXucAOxMbmdklwD1AqbvXhH2Qu8929xJ3L+nevXurFCsiItEFxFqgr5n1NrOOwARgYXwDMxsCPE4QDrsjqktERBoRSUC4ey1wB/AasAl4wd0rzex+MyuNNfs3oDPwopmtN7OFjXyciIhEIKo+CNx9MbA4Yd3UuOVLoqpFRESapjupRUQklAJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgREQklAJCRERCKSBERCSUAkJEREIpIEREJJQCQkREQikgJFJLliyhf//+5Ofn88ADDxzxfk1NDddccw35+fkMHz6cbdu2AbBmzRqKi4spLi5m8ODBvPzyywBs376dUaNGUVBQQGFhIY888kiUuyOS0RQQEpnDhw9z++238+qrr7Jx40aef/55Nm7c2KDNk08+yWmnnU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JIQc5w7AmcA5wFUEx/xGd69OX5WZIxYG/5tg5NJKd98c914nd6+p+zdtRWaIhGP9urtXxb1ncSHRJu/tUSf10Z0C7DKzXAgefOTuH7j7fOA+gpuLRqezwAyReJwPxzqpFwJ3A18SjP6Q1Pg+UELQ+T/dzB42s2vMLDsWDl8DHk5viRkj/lj/xMweMrOrzezM2KXTHmb2eFsMB9AZxFHF5lx6ieApeJPd/f2E9x8FOrj7LemoL1PoOEcndnb2KsENn5sJzoYLCC4t1QJvAn8P7HH3q9JVZyZoxrFeTdBB3WaPdWRPlGuPYgl/N/AgsN7M3iH4IltGMFStlOCOamkBHedIdQTmENz4uRpYGTtjGEJwSe+vgQsJOqilZZo61gW08WOtM4hmMrNzgCsJromfSfDltcTdn0prYRlGxzkadVOXJN4lbWaTgOnufkYay8so7flYKyCOQWxoYEd335fuWjKZjnN06r68zGwawQ1b96S7pkzVno61AkJE6plZN+DP7v5FumvJdO3hWCsgREQklIa5iohIKAWEiIiEUkCIiEgoBYSIiIRSQIiISCgFhIiIhPr/E+MeRrxO4D0AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAHCtJREFUeJzt3Xt8FfWd//HXByiyKPVCQlsIghgEQe7BFrVV1G40rHH1pwI+ShUQurtS1ypbdRepP1l/XvbnZVu0rRa8oCVeUEFFlMVSxdpCUFQuRVKgEnTlUsEqC+HAZ/+Yk3iSTMg5JGcmHN7Px4NHZuZ8zzmfmdq8853vzHfM3REREamrVdwFiIhIy6SAEBGR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15dq82MGTM49thjqaio4Ec/+hE33HADAA899BAA77//PgsXLuT6669n//79AEyePJk//vGPvPPOO7z55pu8/LImqBWRQ4cCAli6dCmFhYX06NGDtm3bMmrUKObOnVurzdy5c7niiisAuOSSS1i0aBHuzurVqznnnHMA6NSpE8cccwzl5eW0b9+e4cOHA9C2bVsGDx5MZWVltDsmItIECghg8+bNdO365WSzBQUFbN68ucE2bdq04eijj2b79u0MGDCAuXPnkkgk2LBhA8uXL2fTpk213rtjxw5eeOGFmiARETkURDYXU0vmXv/RFGaWVptx48axZs0aioqK6NatG6eddhpt2nx5WBOJBKNHj+aaa66hR48ezV+8iEiWKCAIegypf/VXVlbSuXPn0DYFBQUkEgl27tzJcccdh5lx77331rQ77bTT6NmzZ836xIkT6dmzJ9dee232d0REpBnpFBMwdOhQ1q1bx4YNG6iqqqKsrIzS0tJabUpLS3n00UcBeOaZZzj77LMxM3bt2sUXX3wBwMKFC2nTpg19+vQBYMqUKezcuZP77rsv2h0SEWkG6kEQjClMnz6d4uJi9u3bx7hx4+jbty9Tp06lqKiI0tJSxo8fz5gxYygsLOS4446jrKwMgC1btlBcXEyrVq3o0qULs2bNAoJeyG233Ubv3r0ZPHgwAJMmTeKqq66KbT9FRDJhYefWDxVFRUVeXl4edxkiLUb3G1+K9fs33jEi1u+X9JjZcncvaqydTjGJiEgoBYSIiIQ6bMcg1BUXETkw9SBERCSUAkJEREIpIEREmuhgZ4NeuHAhQ4YMoV+/fgwZMoTXXnsNgL/+9a8MHDiw5l9eXl4sN9setmMQIiLNoXo26IULF1JQUMDQoUMpLS2tuWEWas8GXVZWxg033MCTTz5JXl4eL7zwAp07d2blypUUFxezefNmOnTowIoVK2reP2TIEC6++OLI9009CBGRJmjKbNCDBg2qmdanb9++7N69mz179tR677p169iyZQvf/va3o9mhFAoIidTBdsW3b9/O8OHDOeqoo5g0aVKt91RVVTFx4kROOukkevfuzZw5c6LYFRGgabNBp5ozZw6DBg3iiCOOqLV99uzZjBw5st4EolHQKSaJ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mFkxcL+7FybX2xA8O3sIMIIgKK5097pPx5MMhBzn1sA3gMHAxQTHfKy7V8ZXZe5IhsG1BFcuLXH3tSmvHeHue6p/xlZkjqhzrH/r7hUpr1lKSLTIe3s0SH1gRwKfmFlXCB585O5/dvdngZsJbi4qjrPAHFH3OO9LDlLPA/4V2E9w9Yc0j5uAIoLB/9vN7F4zG2lmXZLh8HXg3nhLzBmpx/ouM7vHzC4xs28kT512MrNftsRwAPUgDig559IzBE/Bu87d19d5/QGgtbv/II76coWOc3SSvbOXCW74XEvQGz6Z4NRSAvg98PfANne/OK46c0Eax/otggHqFnusI3ui3KEomfD/CtwNrDCzdwl+kb1GcKlaKcEd1dIEOs6Rags8SnDj51vAkmSPYRDBKb3ewBkEA9TSNI0d65Np4cdaPYg0mdlg4EKCc+LfIPjltcDdZ8ZaWI7RcY5G9dQlde+SNrOJwO3u3jHG8nLKoXysFRAHIXlpYFt33xl3LblMxzk61b+8zGwawQ1b/xZ3TbnqUDrWCggRqWFmecAX7v4/cdeS6w6FY62AEBGRULrMVUREQikgREQklAJCRERCKSBERCSUAkJEREIpIEREJNT/Av+/AX61XC81AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAG/BJREFUeJzt3X14FeWd//H3N4noKioi0IoBEUMwCWCQgFKsD6gFRKNY5OHqIgUEu2rXn/35gOsutuoutkXb9ULcuj6AdiEgWKEV8QFq1VaF2FIVFImAEnCB8gOsqCGB7++POcTDYULOMcmc5PB5XZeXM3PuyfnO1OaTe2bue8zdERERSZSV7gJERKR5UkCIiEgoBYSIiIRSQIiISCgFhIiIhFJAiIhIKAWEiIiEUkCIiEgoBYSIiIRSQIiISKicdBfQEO3atfMuXbqkuwwRkRblrbfe+pu7t6+vXYsOiC5dulBeXp7uMkREWhQz+yiZdrrEJCIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIg20ZMkSunfvTl5eHvfee+9Bn990000UFxdTXFxMfn4+bdq0qf3s448/5jvf+Q4FBQUUFhayYcMGAL73ve/RvXt3evTowfjx46muro7qcL7i7i32nz59+riISDrV1NR4165d/cMPP/Sqqirv1auXr1q1qs72DzzwgI8bN652/bzzzvMXXnjB3d3//ve/++7du93d/dlnn/V9+/b5vn37fNSoUT5jxoxGqxko9yR+x6oHISLSAMuXLycvL4+uXbvSqlUrRo0axcKFC+tsP2fOHEaPHg3A6tWrqamp4eKLLwagdevWHH300QBccsklmBlmRr9+/aisrGz6g0mggBARaYBNmzbRqVOn2vXc3Fw2bdoU2vajjz5i/fr1DBw4EIAPPviANm3acOWVV9K7d29uueUW9u7de8A+1dXVPPnkkwwePLjpDqIOCggRkQYIrtgcyMxC25aVlTF8+HCys7MBqKmp4dVXX2XatGmsWLGCdevWMXPmzAP2ue666zj33HP59re/3ei110cBISLSALm5uWzcuLF2vbKyko4dO4a2LSsrq728tH/f3r1707VrV3Jycrjiiiv485//XPv5T37yE7Zt28b999/fdAdwCJEFhJkNNrM1ZlZhZpNDPu9sZr83s7+Y2dtmdklUtYmIfF19+/Zl7dq1rF+/nj179lBWVkZpaelB7dasWcOOHTvo37//Afvu2LGDbdu2AbBs2TIKCwsBeOSRR3j++eeZM2cOWVnp+Vs+km81s2zgQWAIUAiMNrPChGb/Csxz997AKGBGFLWJiDRETk4O06dPZ9CgQRQUFDBixAiKioqYMmUKixYtqm03Z84cRo0adcDlp+zsbKZNm8aFF15I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X5WZIxYG/4fgyaXX3H1N3GdHunvV/n+nrcgMkXCu/+DuFXGfWVxINMuxPbpJfWjHAFvMrBMELz5y94/c/Wng3wgGFw1KZ4EZIvE8743dpF4E/Auwj+DpD2kctwMlBDf/p5rZL8xspJmdHAuHbwK/SG+JGSP+XP/MzO43s+FmdlLs0mkHM/tVcwwHUA/ikGJzLs0neAvej9x9XcLnM4Bsd782HfVlCp3n6MR6Z88RDPhcQ9AbLiC4tFQDvAFcAfzN3a9MV52ZIIlz/TrBDepme64je6NcSxRL+H8B7gNWmtlfCX6RLSN4VK2UYES1NIDOc6RaAbMIBn6+DrwW6zH0JrikdzpwDsENammY+s51Ac38XKsHkSQzOxO4nOCa+EkEv7yWuPtjaS0sw+g8R2P/1CWJo6TNbBIw1d1PTGN5GaUln2sFxNcQezSwlbvvSnctmUznOTr7f3mZ2d0EA7buSHdNmaolnWsFhIjUMrN2wG53/yLdtWS6lnCuFRAiIhJKj7mKiEgoBYSIiIRSQIiISCgFhIiIhFJAiIhIKAWEiIiE+v/aBMYKSaUW/AAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEFCAYAAAD5bXAgAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDMuMC4wLCBodHRwOi8vbWF0cGxvdGxpYi5vcmcvqOYd8AAAHBhJREFUeJzt3X10VfWd7/H3F1J0QHwEqhgUYwBDFAIEkPHWFq0DwkwclCLU4hMVaXW81norc8dFrdorrVerU2AE0fLgFEStQ6w8LAfqteIDhCtWEmURBU2AkWgFLiokod/7xz7Ek5Mdck7J2Sc5fF5rZbEffvuc794u88lv7/3b29wdERGRRB0yXYCIiLRNCggREQmlgBARkVAKCB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3794AdOjQOFP79u3bMN2zZ0969OhBTU0NJ598MmPGjGlYN2zYMKqrq9O4FyIirUs9CGDHjh306vXVMI3c3Fx27NiR8uesX7+e2tpazj333EbL6+rqWLx4MaNHjz7qWkVEoqIeBODedFC3Wdjg7+bt2rWLyZMns3Dhwia9jB/+8IdcfPHFfOMb3ziqOkVEoqSAIOgxVFV99aio6upqevbsmfT2+/btY+zYsdx///1ceOGFjdb97Gc/o6amhrlz57ZavSIiUdApJmDo0KFs3bqVbdu2UVtby9KlSykpKWl5Q6C2tpZx48Zx7bXX8p3vfKfRuvnz57N69WqWLFnSpFchItLW6bcWkJOTw6xZsxg1ahQFBQVMmDCBwsJCZsyYQWlpMKB7w4YN5Obm8swzz3DzzTdTWFgIwLJly3jllVdYsGABRUVFFBUVsWnTJgCmTZvGxx9/zIgRIygqKuLee+/N2D6KiKTKws6/txfFxcVeVlaW6TKkBb2nv5jR798+c2xGv1+krTGzje5e3FI79SBERCTUMXuRWn/ViogcmXoQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIiISSgEhIiKhFBAiIhJKASEiIqEUECIiEkoBISIioRQQIllq1apV9OvXj/z8fGbOnNlk/cGDB7n66qvJz89n+PDhbN++HYCXXnqJIUOGcMEFFzBkyBDWrl0LwBdffMHYsWM577zzKCwsZPr06VHuTpvW2scaYPTo0QwcOJDCwkKmTZvGoUOHotqdBgoIkSx06NAhbrnlFlauXElFRQVLliyhoqKiUZsnnniCU045hcrKSn70ox9x1113AdCtWzdeeOEF3nnnHRYuXMjkyZMbtrnzzjt57733eOutt1i3bh0rV66MdL/aonQd62XLlvH222+zefNmampqeOaZZyLdL1BAiGSl9evXk5+fT15eHp06dWLixIksX768UZvly5dz3XXXATB+/HjWrFmDuzNo0KCGd7IXFhZy4MABDh48SOfOnRk5ciQAnTp1YvDgwVRXV0e7Y21QOo41wIknnghAfX09tbW1mFmEexVQQIhkoR07dtCrV6+G+dzcXHbs2NFsm5ycHE466SQ+/fTTRm2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IJRvcPfqzFWZPWJhcDuwlmCg55a4dce5+8HD/2asyCyRcKz/j7tXxq2zuJBok2N7dBfTkT1PMBDu17ELSw1ivYb3CbrmcnS6AB+bWS8Adz/k7tWxF0n9T+AvBHd/SOv4Z6AYGAk8YGa/MrOrzezMWDicDvwqsyVmjfhj/Usze9jMxpvZGbFTpz3MbG5bDAdQD6JFsXPjDwEXA28TjHlYC3wTmA6Md/c3Mldh+xe7z/5ZgrcN3uHuHySsnwN0dPebM1FfNon1zlYSPBFgC8Hp0gKCU0v1wBvAPwKfuPuVmaozGyRxrF8nuEDdZo+1AiJJZjaY4La0KwlOf6wFVrn7kxktLEsoiKMRuyh9JcGTAV6PLTsdGERwSu9sgpsFhrr7xowVmgWy4VgrIP4Ksf/wndx9b6ZryTYK4mgcfnRJ4vPDzGwq8IC7n5bB8rJKez7WCghpsxTE0Tn8y8vM7gM6uPu/ZLqmbNWejrUCQkQamFk34HN3/zLTtWS79nCsFRAiIhJKt7mKiEgoBYSIiIRSQIiISCgFhIiIhFJAiIhIqP8P3nO0U/BY/7IAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "print('results_ii')\n",
    "for circuit in list(results_ii.get_names()):\n",
    "    plot_histogram(results_ii.get_counts(circuit))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$\\square$."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Appendix:"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Next steps:\n",
    "\n",
    "Thank you for reading through this tutorial! The author hopes that it has been a helpful experience in getting started with Qiskit and quantum circuitry. For moving forward, consider the following projects:\n",
    "   - Edit this notebook such that it can run on an actual quantum chip! By looking at the documentation/configuration of backends either online or through the `IBMQ.get_backend('backend_name').configuration()` method, you can find the connectivity map and then set up a circuit implementation that satisfies the 2-qubit gate constraints from this connectivity map. I strongly recommend this, as this is a vital step to using the coolest feature of Qiskit, which is interfacing with actual quantum backends.\n",
    "   - Implement an entirely different circuit.\n",
    "   - Try generating circuits by uploading QASM strings.\n",
    "   - Follow through with the provided tutorial files on the Qiskit GitHub\n",
    "   - Look through the provided further readings in the appendix notebook.\n",
    " "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Further reading\n",
    "\n",
    "While this tutorial aims to introduce the quantum computational focus topic of reading and evaluating circuit diagrams as best as it can, there is still a wealth of literature beyond this point that ought to be read by those who are intrigued by the subject. The internet is rife with hype (understandably so) about the subject that can obscure source-finding, so here are some pointers:\n",
    "\n",
    " - Quantum Computing Explained, D. McMahon (hardcover text, a good starting point for those without much physics background)\n",
    " - Quantum Computation and Quantum Information (10th Anniversary Edition), M. A. Nielsen and I. L. Chuang (pdf available online, really good monograph on theory and experimental realization of quantum computation)\n",
    " - Principles of Quantum Mechanics, R. Shankar (physics textbook for background in quantum mechanics)\n",
    " - Introduction to Quantum Mechanics, D. Griffiths (physics textbook for background in quantum mechanics)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
